270 Commits

Author SHA1 Message Date
Philippe Duveau
c8d8871aea
Merge branch 'AIX_Port_step2' into master 2019-02-21 09:23:40 +01:00
Rainer Gerhards
00f09d8723
cleanup: use less verbose C11 method to use pragmas 2019-02-20 17:13:28 +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
ca49b004d0
bugfix debug output: date property options output wrongly
inside debug logging, the date property options were not all
properly converted into strings. Some of the newer ones were
invalidly flagged as "UNKNOWN". This is primarily a cosmetic
problem and has no effect other than puzzling folks looking at
the debug log.
2018-11-27 11:49:25 +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
531e356a64
cleanup: remove commented-out code, simplify a bit
commented-out code detected by lgtm.com
2018-10-29 09:14:13 +01:00
Rainer Gerhards
26db406974
cleanup: remove no longer needed code
array mode templates are no longer supported

If they are needed again, check v7 for importing code
2018-09-26 18:55:31 +02:00
PascalWithopf
c83e3ed216 correct codestyle in rsyslog part 2 2018-08-01 16:11:33 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
69cc25ddd7
cleanup: another FIXME that wasn't removed in time... 2018-07-02 13:36:07 +02:00
Rainer Gerhards
93bebb1f1f template: add option to generate json "container"
This enables easy JSON generation via template.

This commit also corrects an issue with the constant "jsonf"
format. That was recently added, and the implementation problem
only became visible when used inside a larger json object. No
officially released code is affected, thought - so it rellay
is just a side-note.

closes https://github.com/rsyslog/rsyslog/issues/2347
2018-02-16 08:22:49 +01:00
Rainer Gerhards
87f296fd2e core/template: add format jsonf to constant template entries
closes https://github.com/rsyslog/rsyslog/issues/2348
2018-02-10 19:04:40 +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
Jan Gerhards
ceddd7e75d template: use new errmsg interface 2017-11-15 13:03:57 +01:00
PascalWithopf
e485c5c5bc codestyle: shorten lines to max 130 chars 2017-11-15 09:04:42 +01:00
Rainer Gerhards
741aaf87d3 core/template bugfis: potential NULL pointer access at config load
could happen if the config was loaded and the parameters could not
properly be processed. If so, this occured only during the startup
phase.

Detected by Coverity scan, CID 185318
2017-11-11 15:25:01 +01:00
Rainer Gerhards
ed9b9ba877 simplify code
Detected by Coverity scan, CID 185356
2017-11-09 19:17:55 +01:00
Rainer Gerhards
a83b72e5f6 template: fix potential NULL pointer access
could happen during config processing on invalid config parameters

Detected by Coverity scan, CID 185437
2017-10-31 13:00:33 +01:00
Rainer Gerhards
72496ac8b4 core/template: fix double free due to 9e3efd4960eb6133c99b0842e5a717ba37b5cda1
Fix 9e3efd4960eb6133c99b0842e5a717ba37b5cda1 was incomplete, causing
a double-free.

Detected by Coverity scan, CID 185476
2017-10-30 09:40:16 +01:00
Rainer Gerhards
07609d5794 template object: NULL pointer access on invalid parameters
could happen only during startup

Detected by Coverity scan, CID 185376
2017-10-29 19:13:04 +01:00
Rainer Gerhards
9e3efd4960 core: fix theoritical memory leak in template processing
can occur if the system is totally out of memory

Detected by Coverity scan, CID 185321
2017-10-29 19:13:04 +01:00
Rainer Gerhards
309f2439cc core/template: detect potential internal logic error
problem identified by clang static analyzer. Extremely
unlikely, so currently handled by given an appropriate
error message and return state.
2017-10-24 11:23:33 +02:00
Rainer Gerhards
8ac4776543 template/bugfix: invalid template option conflict detection
closes https://github.com/rsyslog/rsyslog/issues/1811
2017-10-05 14:49:17 +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
Rainer Gerhards
8d67c03d45 solaris: fix coding issues 2017-04-11 10:18:42 +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
a31015abe2 template emergency json escaping: use slash instead of backslash
This is only triggered if we do not get memory to do proper escaping,
so this code is unlikely to be executed. However, we think that
forwards slash is a better susbstitute for backslash than is the
single quote char.
2016-10-26 11:59:38 +02:00
Rainer Gerhards
b0dc6c16f2 fix json template encoding (correct predicate check)
commit 27af112637b47fd80c9ffb80565e61e049b88774 tried to fix
json encoding, but introduced an invalid predicate check that
lead to no encoding at all.

see also https://github.com/rsyslog/rsyslog/pull/1216
2016-10-26 11:54:29 +02:00
usuario
27af112637 Modified template to add "\\" on doEscape for JSON_ESCAPE fixing #1126 2016-10-24 22:00:14 +02:00
Rainer Gerhards
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
17553f5195 cleanup: compiler warnings 2016-06-01 09:49:46 +02:00
Rainer Gerhards
5e4671b765 fix potential misadressing (could cause segfault on startup)
Happens when template name shorter than two chars and outname
is not set. Once we are over startup, things work reliably.

This was a bug that's present for quite a while.
2016-05-19 17:34:31 +02:00
Rainer Gerhards
822ef895ff fix mem leak
This was present for quite a while, new clang 3.8 static anaylzer
finally detected it.
2016-05-19 17:33:14 +02:00
Rainer Gerhards
7989397975 fix bugs introduced today (found by clang static analyzer) 2016-05-19 17:19:29 +02:00
Rainer Gerhards
8e532e0d9f simplify code - remove unnecessary type conversions 2016-05-19 11:58:49 +02:00
Rainer Gerhards
f8738727f9 change cstrFinalize() interface
the function can no longer fail and it is not expected that this
will ever happen again in the future. So we remove the return value,
giving a small speedup to the code.
2016-05-19 10:49:37 +02:00
Rainer Gerhards
43fad84a45 templates: add new option "compressspace"
closes https://github.com/rsyslog/rsyslog/issues/861
2016-03-23 17:05:34 +01:00
Rainer Gerhards
0ab2ba2ff2 add template option "date-utc" to emit time in UTC
closes https://github.com/rsyslog/rsyslog/issues/730
2016-03-22 12:27:39 +01:00
Peter Portante
84f5608157 Fix upper and mixed case variable references
We could not reference mixed or upper case variables properly prior to
this change, as they were always lowercased before references were
pulled.

The new "option.casesensitive" for templates allows folks to turn on
variable name reference case sensitivity on a template by template
basis.
2015-12-19 16:17:11 +00:00
Rainer Gerhards
4de6ec4d39 Merge branch 'fix-sizeof-char' of https://github.com/portante/rsyslog into master-candidate
Conflicts:
	template.c
2015-12-16 09:26:00 +01:00
Rainer Gerhards
21d981a05f Merge branch 'c6226-patch-1' of https://github.com/c6226/rsyslog 2015-12-16 09:19:34 +01:00
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
c6226
5c430382e7 memory overflow 2015-12-15 09:34:44 +08:00
Rainer Gerhards
d4d64bab44 cleanup: remove unnecessary NULL check before free() 2015-12-14 16:39:15 +01:00
xushengping
4442e28c4e template:fix memory leak 2015-12-11 16:30:36 +08:00
Peter Portante
c95e863c37 Tighten down code under analysis 2015-12-09 23:28:18 +00:00
Rainer Gerhards
7463d7c18f fix: invalid return code check
detected by clang static analyzer
2015-12-06 11:36:41 +01:00