29 Commits

Author SHA1 Message Date
Rainer Gerhards
0d6445c1fc mmexternal: fix memory leak
This was induced by a change to the lower-level message object quite
a while ago.

Detected by Coverity scan, CID 185332
2017-10-29 19:13:04 +01:00
Rupert
a6a24abf13 portability: fixes needed to build on osx
Thanks to github user hdatma
2017-05-15 09:05:05 +02: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
5e3b075d53 fix compiler warnings 2016-06-02 12:08:55 +02:00
Rainer Gerhards
f9ada8897f mmexternal: fix extra printf parameter 2016-01-13 05:09:10 -05:30
Rainer Gerhards
2e55c77d70 clean up doAction output module interface
We started with char * pointers, but used different types of pointers
over time. This lead to alignment warnings. In practice, I think this
should never cause any problems (at least there have been no reports
in the 7 or so years we do this), but it is not clean. The interface is
now cleaned up. We do this in a way that does not require modifications
to modules that just use string parameters. For those with message
parameters, have a look at e.g. mmutf8fix to see how easy the
required change is.
2016-01-13 04:04:26 -05:30
Rainer Gerhards
836a7c8b3f Merge branch 'fix-dbg-stmts' of https://github.com/portante/rsyslog into master-candidate
Conflicts:
	grammar/rainerscript.c
	plugins/mmexternal/mmexternal.c
	plugins/omprog/omprog.c
2015-12-06 15:21:22 +01:00
Rainer Gerhards
8bf5284167 cleanup: debug messages that weren't meant to stay
removed debug messages that were orignally added just for testing
during feature development

see also https://github.com/rsyslog/rsyslog/pull/652

Thanks to Peter Portante for alerting me on them.
2015-12-06 13:47:36 +01:00
Peter Portante
752d32f600 Bury es_str2cstr() calls under explicit Debug test
In rainerscript.c there was a wayward debug statement emitting a es str,
where the es string was converted to a c-string before printing, and
then freeing the memory. It would seem doing that on the fast path is
unnecessary, so we moved it under an explicit Debug test.

Searching for other uses of es_str2cstr() calls in dbgprintf() calls
(lowercase), which would mean that the memory allocation always occurs
even if the debugging is not enabled, we found two in omprog and
mmexternal.

In the modules that we touched, we switched to use DBGPRINTF() were
possible and logical, to avoid processing any parameters on the fast
path.
2015-12-05 01:43:44 +00:00
2edfb087b8 FreeBSD: Fixed mulitple compile issues in plugins.
Also fixed headers for Freebsd in test tools.
2015-07-14 14:28:29 +00:00
Chris Hiszpanski
20d869968b Added LIBLOGGING_STDLOG_CFLAGS and LIBLOGGING_STDLOG_LIBS to automake sources
Build was failing when using these variables
2014-09-25 05:06:57 -07:00
Rainer Gerhards
fc3c2bdcfb bugfix: mmexternal remove framing char before processing JSON reply
This did not have any real bad effects, but caused unnecessary
processing, as empty replies were not properly detected. Otherwise,
the bug was not noticible from the user's PoV.
2014-05-01 11:39:22 +02:00
Rainer Gerhards
e7bfdbea5c bugfix: mmexternal segfault due to invalid free in non-json input mode
closes: https://github.com/rsyslog/rsyslog/issues/70
2014-05-01 11:33:28 +02:00
Rainer Gerhards
5ff5a16718 bugfix: mmexternal segfault when external plugin sent invalid reply
... or no reply at all. This happened if the reply was imporper JSON.
Now, we emit an error message in those cases.
see also: https://github.com/rsyslog/rsyslog/issues/69
2014-04-30 13:01:31 +02:00
Rainer Gerhards
b43ce5db61 bugfix: mmexternal did potentially pass incomplete data to restarted external plugin
This could happen if EPIPE was returned "too late", in which case the
beginning of the data could be lost.
2014-04-28 17:24:44 +02:00
Rainer Gerhards
d385aa6dc0 bugfix: mmexternal did not properly process messages over 4KiB
The data to be passed to the external plugin was truncated after 4KiB.
see: https://github.com/rsyslog/rsyslog/issues/64
2014-04-28 17:21:40 +02:00
Rainer Gerhards
461310c89f bugfix/mmexternal: memory leak 2014-04-15 13:48:34 +02:00
Rainer Gerhards
3fcccc4098 typo fix 2014-04-13 18:46:00 +02:00
Rainer Gerhards
f860025bd4 mmexternal: support "json" inbound message passing 2014-04-08 12:24:28 +02:00
Rainer Gerhards
90e2a1a8df add modifiable properties to external message modification module interface
The set is still incomplete, but I noticed that it is better to add some
"const" definitions to older versions (probably v7-stable) before
continuing.
2014-04-04 08:19:14 +02:00
Rainer Gerhards
2996241346 mmexternal: new solid external plugin response reader
we can now read arbitrary long responses; PoC code replaced.
2014-04-02 13:09:37 +02:00
Rainer Gerhards
ec1007f154 mmexternal: remove remains of template use
No longer needed/possible due to message passing mode (leftover)
2014-03-17 18:55:43 +01:00
Rainer Gerhards
90773b0ac6 mmexternal: add "interface.input" config parameter
permits to specify what should be passed to external program
2014-03-17 18:54:03 +01:00
Rainer Gerhards
a7c6b9cde5 milestone/mmexternal: support replacing msg property, fix stall in mmexternal 2014-03-17 08:00:21 +01:00
Rainer Gerhards
969ae613b9 milestone/mmexternal: change to use message passing interface
this is required as we need to modify the messages; this also means
tempates can not be used when sending data to it.
2014-03-16 15:54:52 +01:00
Rainer Gerhards
2fd9f783c8 mmexternal: funnel program reply through to msg object 2014-03-09 18:53:34 +01:00
Rainer Gerhards
c2a6f8d3cb make mmexternal read synchronously from external program 2014-03-08 17:03:21 +01:00
Rainer Gerhards
508bd638e4 add mmexternal skeleton (support external message mod plugins) 2014-03-06 17:40:57 +01:00