Browse Source

New upstream version 8.31.0

upstream upstream/8.31.0
Michael Biebl 5 years ago
parent
commit
ec1711bb2a
  1. 2
      .tarball-version
  2. 375
      ChangeLog
  3. 6
      Makefile.in
  4. 65
      action.c
  5. 6
      compat/Makefile.in
  6. 3
      config.h.in
  7. 205
      configure
  8. 21
      configure.ac
  9. 6
      contrib/imczmq/Makefile.in
  10. 54
      contrib/imczmq/imczmq.c
  11. 6
      contrib/imkmsg/Makefile.in
  12. 6
      contrib/imzmq3/Makefile.in
  13. 56
      contrib/imzmq3/imzmq3.c
  14. 6
      contrib/mmcount/Makefile.in
  15. 16
      contrib/mmcount/mmcount.c
  16. 6
      contrib/mmgrok/Makefile.in
  17. 2
      contrib/mmgrok/README
  18. 6
      contrib/mmrfc5424addhmac/Makefile.in
  19. 6
      contrib/mmsequence/Makefile.in
  20. 6
      contrib/omamqp1/Makefile.in
  21. 2
      contrib/omamqp1/omamqp1.c
  22. 6
      contrib/omczmq/Makefile.in
  23. 28
      contrib/omczmq/omczmq.c
  24. 6
      contrib/omhiredis/Makefile.in
  25. 1
      contrib/omhiredis/omhiredis.c
  26. 6
      contrib/omhttpfs/Makefile.in
  27. 2
      contrib/omhttpfs/omhttpfs.c
  28. 6
      contrib/omrabbitmq/Makefile.in
  29. 9
      contrib/omrabbitmq/omrabbitmq.c
  30. 6
      contrib/omtcl/Makefile.in
  31. 5
      contrib/omtcl/omtcl.c
  32. 6
      contrib/omzmq3/Makefile.in
  33. 11
      contrib/omzmq3/omzmq3.c
  34. 6
      contrib/pmaixforwardedfrom/Makefile.in
  35. 6
      contrib/pmcisconames/Makefile.in
  36. 6
      contrib/pmpanngfw/Makefile.in
  37. 6
      contrib/pmsnare/Makefile.in
  38. 6
      contrib/pmsnare/pmsnare.c
  39. 8
      dirty.h
  40. 6
      grammar/Makefile.in
  41. 341
      grammar/grammar.c
  42. 2
      grammar/grammar.h
  43. 9
      grammar/grammar.y
  44. 4
      grammar/parserif.h
  45. 128
      grammar/rainerscript.c
  46. 3
      grammar/rainerscript.h
  47. 11
      parse.c
  48. 6
      plugins/im3195/Makefile.in
  49. 6
      plugins/imdiag/Makefile.in
  50. 15
      plugins/imdiag/imdiag.c
  51. 6
      plugins/imfile/Makefile.in
  52. 98
      plugins/imfile/imfile.c
  53. 6
      plugins/imgssapi/Makefile.in
  54. 53
      plugins/imgssapi/imgssapi.c
  55. 6
      plugins/imjournal/Makefile.in
  56. 260
      plugins/imjournal/imjournal.c
  57. 6
      plugins/imkafka/Makefile.in
  58. 270
      plugins/imkafka/imkafka.c
  59. 6
      plugins/imklog/Makefile.in
  60. 6
      plugins/immark/Makefile.in
  61. 6
      plugins/impstats/Makefile.in
  62. 6
      plugins/imptcp/Makefile.in
  63. 41
      plugins/imptcp/imptcp.c
  64. 6
      plugins/imrelp/Makefile.in
  65. 14
      plugins/imrelp/imrelp.c
  66. 6
      plugins/imsolaris/Makefile.in
  67. 6
      plugins/imtcp/Makefile.in
  68. 12
      plugins/imtcp/imtcp.c
  69. 6
      plugins/imudp/Makefile.in
  70. 4
      plugins/imudp/imudp.c
  71. 6
      plugins/imuxsock/Makefile.in
  72. 32
      plugins/imuxsock/imuxsock.c
  73. 6
      plugins/mmanon/Makefile.in
  74. 398
      plugins/mmanon/mmanon.c
  75. 6
      plugins/mmaudit/Makefile.in
  76. 2
      plugins/mmaudit/mmaudit.c
  77. 6
      plugins/mmdblookup/Makefile.in
  78. 9
      plugins/mmdblookup/mmdblookup.c
  79. 6
      plugins/mmexternal/Makefile.in
  80. 29
      plugins/mmexternal/mmexternal.c
  81. 6
      plugins/mmfields/Makefile.in
  82. 3
      plugins/mmfields/mmfields.c
  83. 6
      plugins/mmjsonparse/Makefile.in
  84. 4
      plugins/mmjsonparse/mmjsonparse.c
  85. 6
      plugins/mmnormalize/Makefile.in
  86. 6
      plugins/mmpstrucdata/Makefile.in
  87. 4
      plugins/mmpstrucdata/mmpstrucdata.c
  88. 6
      plugins/mmrm1stspace/Makefile.in
  89. 2
      plugins/mmrm1stspace/mmrm1stspace.c
  90. 6
      plugins/mmsnmptrapd/Makefile.in
  91. 6
      plugins/mmutf8fix/Makefile.in
  92. 6
      plugins/omelasticsearch/Makefile.in
  93. 488
      plugins/omelasticsearch/omelasticsearch.c
  94. 6
      plugins/omgssapi/Makefile.in
  95. 5
      plugins/omgssapi/omgssapi.c
  96. 6
      plugins/omhdfs/Makefile.in
  97. 6
      plugins/omjournal/Makefile.in
  98. 9
      plugins/omjournal/omjournal.c
  99. 6
      plugins/omkafka/Makefile.in
  100. 521
      plugins/omkafka/omkafka.c

2
.tarball-version

@ -1 +1 @@
8.30.0
8.31.0

375
ChangeLog

@ -1,4 +1,364 @@
------------------------------------------------------------------------------
Version 8.31.0 [v8-stable] 2017-11-28
- NEW BUILD DEPENDENCY: ommongodb now requires libmongo-c
instead of deprecated libmongo-client.
- remove systemd embedded code, use libsystemd instead
Since the early days rsyslog used the orginal systemd embedded
interface code. This version now uses libsystemd where available.
If we do not find libsystemd, we assume the system does not use
systemd, which is a safe assumption nowadays. This ensures we use the
fresh interface code and also removes bloat from our project.
closes https://github.com/rsyslog/rsyslog/issues/1933
- mmanon: add support for IPv6 adresses with embedded IPv4 address
While this format is uncommon, it may still be present in logs and as
such should be supported. It is configurable via individual settings,
though. Especially the number of bits to anonymize may be desired to
be different than in pure IPv6.
- ommongodb: big refactoring, more or less a feature-enhanced rewrite
New features are :
* Handle TLS connexion to mongodb
* Handle MongoDB Replicasets
* Added the 'ssl_ca' and 'ssl_cert' directives to configure tls connexion
* Added 'uristr' directive to configure the connection uri in the form
of 'mongodb://...'
Now uses the official mongo-c-driver library instead of the deprecated
mongo-client library
Special thanks to Hugo Soszynski and Jérémie Jourdin for there hard work
to make this a reality!
See also: https://github.com/rsyslog/rsyslog/pull/1917
- rainerscript: add parse_time() function
Thanks to Stephen Workman for implementing this.
- omelasticsearch: add pipeline support
supports static and dynamic ElasticSearch pipeline parameter.
closes https://github.com/rsyslog/rsyslog/issues/1411
Thanks to github users scibi and WaeCo for the implementation.
- lmsig_ksi_ls12: support asynchronous mode of libksi
- omprog: added error handling and transaction support for external plugins
This permits much better integration of external output modules.
Special thanks to Joan Sala for providing this work!
- imzmq3/omzmq3: marked as deprecated, modules will be remove in v8.41
see also: https://github.com/rsyslog/rsyslog/issues/2100
- imzmq3/omzmq3: fixed build issues with gcc-7
- core: emit error message on abnormal input thread termination
This indicates a serious issue of which the user should be notified.
Was not done so far and caused grief when troubleshooting issues.
- core: refactored locking for json variable access
refactored the method so that it consistent in all functions and easier
to follow. Most importantly, now an as simple as possible locking paradigm
of lock ... unlock within the function. Hopefully easier to understand
both for humans and static code analyzers.
- core: refactored creation of UDP sockets
was very old, hard to follow code; streamlined that a bit
- core/dnscache: refactor locking
keep a simple lock ... unlock scheme within the function. That is
easier to follow for both humans as well as static analyzers.
Also removes Coverity scan CID 185419
- rainerscript: use crypto-grade random number generator for random() function
We now use /dev/urandom if available. If not, we fall back to the weak PRNG.
- imkafka: improve error reporting and cleanup refactoring
- imkafka bugfix: segfault if "broker" parameter is not specified
Now emits warning message instead and uses hardcoded default
(which usually matches where the kafka broker can be found).
fixes https://github.com/rsyslog/rsyslog/issues/2085
- omkafka: improve error reporting
- omkafka: slight speedup do to refactoring of LIST class
double-linked list was used for temporarily undeliverable message tracking
where singly-linked list was sufficient. Changed that.
- TCP syslog: support SNI when connecting as a client
This is done if a hostname is configured and turned off if an IP is used.
Thanks to Art O Cathain for the patch.
see also https://github.com/rsyslog/rsyslog/pull/1393
- msg variable bugfix: potential segfault on variable access
A segfault is likely to happen if during processing a variable with
more than one path component is accessed (e.g. $!path!var) and NO
variables oft hat kind (local, message, global) are defined at all.
closes https://github.com/rsyslog/rsyslog/issues/1920
- ratelimiting bugfix: data race in Linux-like ratelimiter
access to the Linux-like ratelimiter was not properly synchronized, and
the system rate-limiter was not using it in any case.
This could lead to the rate-limit settings not being properly
respected, but no "hard error".
- core/template bugfix: 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
- core/json var subsystem bugfix: segfault in MsgSetPropsViaJSON
Invalid libfastjson API use lead to double-free. This was most importantly
triggerred by mmexternal (but could potentially be triggered by other
uses as well)
closes https://github.com/rsyslog/rsyslog/issues/1822
- core/wrkr threads bugfix: race condition
During e.g. shutdown it could happen that a worker thread was started
and immediately be requested to terminate. In such situations there was
a race the prevented proper initialization. This could lead to follow-on
problems.
We believe (but could not proof) that this also could lead to a hang of
the termination process. Thus we claim to close an issue tracker down
here below, but are not 100% certain it really closes it (we hope for
user feedback on this). In any case, the thread debuger showed invalid
operations and this has been fixed, so it is useful in any case.
closes https://github.com/rsyslog/rsyslog/issues/1959
- core/wtp: potential hang during shutdown
when the wtp worker is cancelled in the final stage of shutting down
while the mutex is locked and there is one worker left, the system
will hang. The reason is that the cancelled thread could not free the
mutex that the other needs in order to shut down orderly.
Deteced with clang thread sanitizer.
- omfwd bugfix: generate error message on connection failure
- imtcp bugfix: "streamdriver.mode" parameter could not be set to 0
- imjournal bugfix: module was defunctional
The open function was broken by commit 92ac801, resulting in
no data being ever read from the journal.
patch bases on the idea of Radovan Sroka given here:
https://github.com/rsyslog/rsyslog/issues/1895#issuecomment-339017357
but follows the current imjournal-paradigm of having the journal
handle inside a global variable.
see also https://github.com/rsyslog/rsyslog/issues/1895
closes https://github.com/rsyslog/rsyslog/issues/1897
- imjournal: refactor error handling, fix error messages
imjournal did not try to recover from errors and used the error state
returned by journal functions incorrectly, resulting in misleading
error messages. Fixed this and also increased the number of error
messages so that it now is easier to diagnose problems with this module.
Also a little bit of internal brush-up.
-mmdblookup bugfix: fix potential segfault due to threading issues
libmaxminddb seems to have issues when running under multiple threads. As
a first measure, we prevent mmdblookup now from running on more than one
thread concurrently.
see also: https://github.com/rsyslog/rsyslog/issues/1885#issuecomment-344882616
- omkafka bugfixes
* statistics counter maxoutqsize could not be reset
Thanks to github user flisky for the patch.
* potential hang condition
omkafka did not release a mutex under some error conditions (most
notably out of memory on specific alloc calls). This lead to a hang
during actively processing messages or during shutdown (at latest).
This could happen only if dynamic topics were configured.
Detected by Coverity Scan, CID 185781 (originally 185721, detected
as a different issue by Coverity after code refactoring done in regard
to 185721 -- then the problem became more obvious).
* file handle leak, which could occur when local buffering
of messages was needed
* invalid load of failedmsg file on startup if disabled
error "rsyslogd: omkafka: could not load failed messages from "
"file (null) error -2027 - failed messages will not be resend."
occurs because, depite `keepFailedMessages="off"` as a default,
omkafka still tries to check for and load a `(none)` file which
triggers an IO error of sorts according to the 2027 link above.
Obviously, it probably shouldn't try load the file if
`keepFailedMessages` is not enabled.
Thanks to github user JPvRiel for a very good error report and
analysis.
closes https://github.com/rsyslog/rsyslog/issues/1765
* various config parameters did not work
These were not even recognized when used and lead to a config startup
error message:
~ closeTimeout
~ reopenOnHup
~ resubmitOnFailure
~ keepFailedMessages
~ failedMsgFile
closes https://github.com/rsyslog/rsyslog/issues/2052
* considerable memory leak
Whenever a message could (temporarily) not be delivered to kafka,
a non-trivial amount of memory was leaked. This could sum up to
quite a big memory leak.
fixes https://github.com/rsyslog/rsyslog/issues/1991
* some small memory leaks fixed
most of them cosmetic or a few bytes statically (not growing as
omkafka was used) -- thus we do not mention each one explicitely.
For more details, see git commit log or this pull request:
https://github.com/rsyslog/rsyslog/pull/2051
- kafka bugfix: problem on invalid kafka configuration values
omkafka ended up in an endless loop and high cpu.
imkafka tried to subscribe to a not connected kafka server.
closes https://github.com/rsyslog/rsyslog/issues/1806
- [io]mgssapi: fix build problems (regression from 8.30.0)
- [io]czmq: fix build problems on some platforms (namely gcc 7, clang 5)
- tcpsrv bugfix: potential hang during shutdown
- queue bugfix: potential hang during shutdown
- queue bugfix: NULL pointer dereference during config processing
If the queue parameters were incorrectly given, a NULL pointer derefernce
could happen during config parsing. Once post that stage, no problem could
occur.
Detected by Coverity scan, CID 185339
- imczmq bugfix: segfault
happened in a call to
371: zcert_destroy(&serverCert) called from rcvData().
Thanks to ~achiketa Prachanda for the patch.
- imfile: some small performance enhancements
Thanks to Peter Portante for the patch
- omfile: hande file open error via SUSPEND mode
For a while, an open file error lead to suspension as the error was
not detected by the rule engine. This has changed with fixes
in 8.30.0. I asked users what they prefer (and expect) and
everyone meant it should still be handled via suspension. See
github tracker below for more details.
closes https://github.com/rsyslog/rsyslog/issues/1832
- omfile bugfix: race during directory creation can lead to loop
There was a race where two threads were competing for directory creation
which could lead to none succeeding and a flood of error message like this
"error during config processing: omfile: creating parent directories for
file". This has been solved.
Thanks to Niko Kortström for the patch.
- imudp: improve error reporting
When udp listener cannot be created, an error message containing
the ip-address and port is put out.
closes https://github.com/rsyslog/rsyslog/issues/1899
- omrelp bugfix: incorrect error handling
if librelp with TLS but without Authentication was included, librelp
did not emit the correct error message due to invalid error code
check. It also did not err-out but instead suspended itself.
Detected by Coverity scan, CID 185362
- [io]mrelp bugfix: segfault on startup if configured cert not readable
When the certificate file specified in the omrelp/imrelp configuration
can't be accessed, e.g. because it doesn't exist or you don't have
permission to do so, a Segmentation Fault will appear when you start
Rsyslog. This commit fixes that problem.
closes https://github.com/rsyslog/rsyslog/issues/1869
- mmanon fix: make build under gcc 7
Thanks to William Dauchy for the patch
- mmpstrucdata bugfix: formatting error of ']' char
This was invalidly formatted as '"'. Thanks to github user
wu3396 for the error report including the patch idea.
closes https://github.com/rsyslog/rsyslog/issues/1826
- mmexternalb bugfix: memory leak
- core/stats bugfix: memory leak if sender stats or tracking are enabled
- core bugfix: potential segfault during startup
A NULL pointer could be accessed if there was a problem with the
timezone parameters. Affects only startup, once started, no problem
existed.
Detected by Coverty scan; CID 185414
- core bugfix: potential race in variable handling
Root of variable tree is accessed prior to locking access to it.
This introduces a race that may result in various kinds of
misadressing.
Found while reviewing code, no bug report exists.
- core bugfix: potential segfault when shutting down rsyslog
when rulesets are nested a segfault can occur when shutting down
rsyslog. the reason is that rule sets are destructed in load order,
which means a "later" ruleset may still be active when an "earlier"
one was already destructed. In these cases, a "call" can invalidly
call into the earlier ruleset, which is destructed and so leads to
invalid memory access. If a segfault actually happens depends on the
OS, but it is highly probable.
The cure is to split the queue shutdown sequence. In a first step,
all worker threads are terminated and the queue set to enqOnly.
While some are terminated, it is still possible that the others
enqueue messages into the queue (which are then just placed into the
queue, not processed). After this happens, a call can no longer
be issued (as there are no more workers). So then we can destruct
the rulesets in any order.
closes https://github.com/rsyslog/rsyslog/issues/1122
- core/action bugfix: potential misadressing when processing hard errors
For batches that did fail in an output module, the rsyslog core
tries to find offending messages that generate hard (non-recoverable)
errors. During this process, the action templates for each message
are copied into a temporary buffer. That copy was invalidly sized,
actually copying only the first template string. As such, outputs
that requested more template strings AND had erros in batch submission
received uninitialized pointers. This could lead to all sorts of
problems.
see also https://github.com/rsyslog/rsyslog/issues/1885
closes https://github.com/rsyslog/rsyslog/issues/1906
- template object bugfix: NULL pointer access on invalid parameters
could happen only during startup
Detected by Coverity scan, CID 185376
- omjournal bugfix: NULL pointer access on invalid parameters
could happen only during startup
- omelasticsearch bugfix: configured credentials not used during health check
Authentication credentials were not applied during health check,
permission to use unsigned CERTS was not applied to regular data post.
closes https://github.com/rsyslog/rsyslog/issues/1949
- omelasticsearch bugfix: abort on unavailable ES server
Depending on the state of unavailability (libcurl return code),
omelasticsearch tries to process a NULL return message, what
leads to a segfault.
This fixes the problem and introduces better error handling and
better error messages.
see also https://github.com/rsyslog/rsyslog/issues/1885
- omelasticsearch: fix memory leak and potential misadressing
Commit 96b5fce introduced regressions, leading to potential misadressing
and a very probable memory leak. This commit fixes the issues and
hardens the module to better detect some error cases in the
future.
It also adds valgrind-based testbench tests which ensure that no
pointer errors exist. If they had been in place, the regressions
would never have been undetected.
Note that commit 96b5fce was introduced in 8.23.0 on Nov, 15th 2016.
Many thanks to Yaroslav Bo for alerting me on the root problem and
providing a very good analysis and guidance.
see also https://github.com/rsyslog/rsyslog/issues/1906
see also https://github.com/rsyslog/rsyslog/issues/1964
closes https://github.com/rsyslog/rsyslog/issues/1962
- omelasticsearch bugfix: output from libcurl to stdout
omelasticsearch made libcurl output messages to stdout. This
commit fixes that. It also automatically enables libcurl verbose
mode during debug runs - it needs to be seen if this is smart or
not (previously, code needed to be commented in).
closes https://github.com/rsyslog/rsyslog/issues/1909
- iczmq bugfix: potential memory leak
- imptcp bugfix: potential misadressing
When during a connection request the remote peer could not be
identified, imptcp could misadress memory if it is configured
to emit messages on connection open.
Detected by clang 5.0 static analyzer.
- imptcp: potential buffer overflow
if the local hostname or IP is larger than NI_MAXHOST-1, an internal
buffer is overflowed. This is irrespective of any input data.
Detected by Coverity scan, CID 185390
- core/nsd_gtls: fix potential unitialized data access
could occur during certificate check
found by clang 5.0 static analyzer
- stats bugfix: potential program hang
due to missing unlock. This could only occur if pstats was set to
CEE-format logging (very uncommon) AND if the system runs out of
memory (in which case other things go pretty bad as well).
found by Coverty scan
- omfwd bugfix: memory leak if network namespaces are used
very seldom used feature, occurs only during error case
found by Coverty scan.
- core: potential misadressing when accessing JSON properties
When a JSON property is accessed in template processing, memory may
have been misadressed or a double-free may occur while obtaining the
propety.
This was detected by a Coverty scan.
- gcry crypto provider bugfixes: potential misadressing and memory leak
If the config parameters were invalid, a misadressing could occur. If so,
this happens only during startup.
Also, a memory leak existed when the crypto provider errored out. This could
build up if it were used in frequently-changing dynafiles. This was
detected by Coverity scan, CID 185360.
- core/file stream object bugfix: memory leak
If a multiline read errored out, a line buffer could be leaked.
Detected by Coverity scan, CID 185328
- imdiag bugfix: double mutex unlock when working with stats
Note: while this could potentially lead to a program hang, it affected
only testbench execution as imdiag is a testbench-only tool.
Detected by Coverity scan, CID 185348 and 185350
- fixed several minor and cosmetic issues found by Coverty scan
includding false positives. For details see "$ git log". All noteworthy
issues are seperately mentioned in this ChangeLog. The ones not mentioned
are for example problems that can only occur during out of memory
conditions, under which it is extremely likely tha the rsyslog process
will be killed in any case
- testbench:
* added compile-check for [io]mgssapi, mmcount
* harden tests against hanging previous instances
* re-enable RELP tests on Solaris
* added basic test for imjournal
* added threading tests via valgrind's helgrind tool
* added valgrind test for kafka modules
* added capability to run elasticsearch tests with
a) different ElasticSearch versions
b) independently from OS-installed version
This also sets base to enable more elaboreate ES tests
* further relaxed timing of dynstats tests, as they tend to create
false positives on slow machines
- CI: improved test coverage on FreeBSD
- Travis: clang static analyzer 5.0 now run over all source files
- build: make compile warning-free under gcc 7
------------------------------------------------------------------------------
Version 8.30.0 [v8-stable] 2017-10-17
- NEW BUILD REQUIREMENTS
* libfastjson 0.99.7 is now mandatory
@ -147,21 +507,6 @@ Version 8.30.0 [v8-stable] 2017-10-17
The predicate check was incorrect.
closes https://github.com/rsyslog/rsyslog/issues/170 (kind of)
- omrelp bugfix: segfault when rebindinterval parameter is used
- omkafka bugfix: invalid load of failedmsg file on startup if disabled
error "rsyslogd: omkafka: could not load failed messages from "
"file (null) error -2027 - failed messages will not be resend."
occurs because, depite `keepFailedMessages="off"` as a default,
omkafka still tries to check for and load a `(none)` file which
triggers an IO error of sorts according to the 2027 link above.
Obviously, it probably shouldn't try load the file if
`keepFailedMessages` is not enabled.
Thanks to github user JPvRiel for a very good error report and
analysis.
closes https://github.com/rsyslog/rsyslog/issues/1765
- kafka bugfix: problem on invalid kafka configuration values
omkafka ended up in an endless loop and high cpu.
imkafka tried to subscribe to a not connected kafka server.
closes https://github.com/rsyslog/rsyslog/issues/1806
- imudp bugfix: UDP oversize message not properly handled
When a message larger than supported by the UDP stack is to be sent,
EMSGSIZE is returned, but not specifically handled. That in turn

6
Makefile.in

@ -403,14 +403,16 @@ LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@
LIBLZ4_CFLAGS = @LIBLZ4_CFLAGS@
LIBLZ4_LIBS = @LIBLZ4_LIBS@
LIBM = @LIBM@
LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@
LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@
LIBMONGOC_CFLAGS = @LIBMONGOC_CFLAGS@
LIBMONGOC_LIBS = @LIBMONGOC_LIBS@
LIBOBJS = @LIBOBJS@
LIBRDKAFKA_CFLAGS = @LIBRDKAFKA_CFLAGS@
LIBRDKAFKA_LIBS = @LIBRDKAFKA_LIBS@
LIBS = @LIBS@
LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@
LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@
LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@
LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
LIBTOOL = @LIBTOOL@
LIBUUID_CFLAGS = @LIBUUID_CFLAGS@
LIBUUID_LIBS = @LIBUUID_LIBS@

65
action.c

@ -134,7 +134,6 @@ static rsRetVal doSubmitToActionQNotAllMark(action_t * const pAction, wti_t * co
DEFobjCurrIf(obj)
DEFobjCurrIf(datetime)
DEFobjCurrIf(module)
DEFobjCurrIf(errmsg)
DEFobjCurrIf(statsobj)
DEFobjCurrIf(ruleset)
@ -432,7 +431,7 @@ actionConstructFinalize(action_t *__restrict__ const pThis, struct nvlst *lst)
int i;
for(i = 0 ; i < pThis->iNumTpls ; ++i) {
if(pThis->peParamPassing[i] != ACT_STRING_PASSING) {
errmsg.LogError(0, RS_RET_INVLD_OMOD, "action '%s'(%d) is transactional but "
LogError(0, RS_RET_INVLD_OMOD, "action '%s'(%d) is transactional but "
"parameter %d "
"uses invalid parameter passing mode -- disabling "
"action. This is probably caused by a pre-v7 "
@ -514,12 +513,12 @@ actionConstructFinalize(action_t *__restrict__ const pThis, struct nvlst *lst)
/* ... set some properties ... */
# define setQPROP(func, directive, data) \
CHKiRet_Hdlr(func(pThis->pQueue, data)) { \
errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", \
LogError(0, NO_ERRCODE, "Invalid " #directive ", \
error %d. Ignored, running with default setting", iRet); \
}
# define setQPROPstr(func, directive, data) \
CHKiRet_Hdlr(func(pThis->pQueue, data, (data == NULL)? 0 : strlen((char*) data))) { \
errmsg.LogError(0, NO_ERRCODE, "Invalid " #directive ", \
LogError(0, NO_ERRCODE, "Invalid " #directive ", \
error %d. Ignored, running with default setting", iRet); \
}
setQPROP(qqueueSetsizeOnDiskMax, "$ActionQueueMaxDiskSpace", cs.iActionQueMaxDiskSpace);
@ -730,7 +729,7 @@ actionSuspend(action_t * const pThis, wti_t * const pWti)
|| (pThis->bReportSuspension && getActionNbrResRtry(pWti, pThis) == 0) ) {
ctime_r(&pThis->ttResumeRtry, timebuf);
timebuf[strlen(timebuf)-1] = '\0'; /* strip LF */
errmsg.LogMsg(0, RS_RET_SUSPENDED, LOG_WARNING,
LogMsg(0, RS_RET_SUSPENDED, LOG_WARNING,
"action '%s' suspended (module '%s'), next retry is %s, retry nbr %d. "
"There should be messages before this one giving the reason for suspension.",
pThis->pszName, pThis->pMod->pszName, timebuf,
@ -785,7 +784,7 @@ actionDoRetry(action_t * const pThis, wti_t * const pWti)
DBGPRINTF("actionDoRetry: %s had success RDY again (iRet=%d)\n",
pThis->pszName, iRet);
if(pThis->bReportSuspension) {
errmsg.LogMsg(0, RS_RET_RESUMED, LOG_INFO, "action '%s' "
LogMsg(0, RS_RET_RESUMED, LOG_INFO, "action '%s' "
"resumed (module '%s')",
pThis->pszName, pThis->pMod->pszName);
}
@ -822,8 +821,9 @@ finalize_it:
static rsRetVal
actionCheckAndCreateWrkrInstance(action_t * const pThis, wti_t * const pWti)
actionCheckAndCreateWrkrInstance(action_t * const pThis, const wti_t *const pWti)
{
int locked = 0;
DEFiRet;
if(pWti->actWrkrInfo[pThis->iActionNbr].actWrkrData == NULL) {
DBGPRINTF("wti %p: we need to create a new action worker instance for "
@ -836,23 +836,31 @@ actionCheckAndCreateWrkrInstance(action_t * const pThis, wti_t * const pWti)
/* maintain worker data table -- only needed if wrkrHUP is requested! */
pthread_mutex_lock(&pThis->mutWrkrDataTable);
locked = 1;
int freeSpot;
for(freeSpot = 0 ; freeSpot < pThis->wrkrDataTableSize ; ++freeSpot)
if(pThis->wrkrDataTable[freeSpot] == NULL)
break;
if(pThis->nWrkr == pThis->wrkrDataTableSize) {
// TODO: check realloc, fall back to old table if it fails. Better than nothing...
pThis->wrkrDataTable = realloc(pThis->wrkrDataTable,
void *const newTable = realloc(pThis->wrkrDataTable,
(pThis->wrkrDataTableSize + 1) * sizeof(void*));
if(newTable == NULL) {
DBGPRINTF("actionCheckAndCreateWrkrInstance: out of "
"memory realloc wrkrDataTable\n")
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
}
pThis->wrkrDataTable = newTable;
pThis->wrkrDataTableSize++;
}
pThis->wrkrDataTable[freeSpot] = pWti->actWrkrInfo[pThis->iActionNbr].actWrkrData;
pThis->nWrkr++;
pthread_mutex_unlock(&pThis->mutWrkrDataTable);
DBGPRINTF("wti %p: created action worker instance %d for "
"action %d\n", pWti, pThis->nWrkr, pThis->iActionNbr);
}
finalize_it:
if(locked) {
pthread_mutex_unlock(&pThis->mutWrkrDataTable);
}
RETiRet;
}
@ -975,7 +983,8 @@ prepareDoActionParams(action_t * __restrict__ const pAction,
CHKiRet(tplToJSON(pAction->ppTpl[i], pMsg, &json, ttNow));
pWrkrInfo->p.nontx.actParams[i].param = (void*) json;
break;
default:dbgprintf("software bug/error: unknown pAction->peParamPassing[%d] %d in prepareDoActionParams\n",
default:dbgprintf("software bug/error: unknown "
"pAction->peParamPassing[%d] %d in prepareDoActionParams\n",
i, (int) pAction->peParamPassing[i]);
break;
}
@ -1172,7 +1181,7 @@ doTransaction(action_t *__restrict__ const pThis, wti_t *__restrict__ const pWti
} else { /* note: this branch is for compatibility with old TX modules */
DBGPRINTF("doTransaction: action '%s', currIParam %d\n",
pThis->pszName, wrkrInfo->p.tx.currIParam);
for(i = 0 ; i < wrkrInfo->p.tx.currIParam ; ++i) {
for(i = 0 ; i < nparams ; ++i) {
/* Note: we provide the message's base iparam - actionProcessMessage()
* uses this as *base* address.
*/
@ -1203,7 +1212,6 @@ actionTryCommit(action_t *__restrict__ const pThis, wti_t *__restrict__ const pW
CHKiRet(actionPrepare(pThis, pWti));
CHKiRet(doTransaction(pThis, pWti, iparams, nparams));
DBGPRINTF("actionTryCommit[%s] past doTransaction\n", pThis->pszName);
if(getActionState(pWti, pThis) == ACT_STATE_ITX) {
iRet = pThis->pMod->mod.om.endTransaction(pWti->actWrkrInfo[pThis->iActionNbr].actWrkrData);
@ -1238,7 +1246,6 @@ DBGPRINTF("actionTryCommit[%s] past doTransaction\n", pThis->pszName);
iRet = getReturnCode(pThis, pWti);
finalize_it:
DBGPRINTF("actionTryCommit[%s] exit %d\n", pThis->pszName, iRet);
RETiRet;
}
@ -1268,18 +1275,19 @@ actionTryRemoveHardErrorsFromBatch(action_t *__restrict__ const pThis, wti_t *__
{
actWrkrInfo_t *const wrkrInfo = &(pWti->actWrkrInfo[pThis->iActionNbr]);
const unsigned nMsgs = wrkrInfo->p.tx.currIParam;
actWrkrIParams_t oneParam;
actWrkrIParams_t oneParamSet[CONF_OMOD_NUMSTRINGS_MAXSIZE];
rsRetVal ret;
DEFiRet;
*new_nMsgs = 0;
for(unsigned i = 0 ; i < nMsgs ; ++i) {
setActionResumeInRow(pWti, pThis, 0); // make sure we do not trigger OK-as-SUSPEND handling
memcpy(&oneParam, &actParam(wrkrInfo->p.tx.iparams, 1, i, 0), sizeof(oneParam));
ret = actionTryCommit(pThis, pWti, &oneParam, 1);
DBGPRINTF("msg %d, iRet %d, content: '%s'\n", i, ret, oneParam.param);
memcpy(&oneParamSet, &actParam(wrkrInfo->p.tx.iparams, pThis->iNumTpls, i, 0),
sizeof(actWrkrIParams_t) * pThis->iNumTpls);
ret = actionTryCommit(pThis, pWti, oneParamSet, 1);
if(ret == RS_RET_SUSPENDED) {
memcpy(new_iparams + *new_nMsgs, &oneParam, sizeof(oneParam));
memcpy(new_iparams + *new_nMsgs, &oneParamSet,
sizeof(actWrkrIParams_t) * pThis->iNumTpls);
++(*new_nMsgs);
}
}
@ -1344,7 +1352,8 @@ actionCommit(action_t *__restrict__ const pThis, wti_t *__restrict__ const pWti)
DBGPRINTF("actionCommit[%s]: somewhat unhappy, full batch of %d msgs returned "
"status %d. Trying messages as individual actions.\n",
pThis->pszName, wrkrInfo->p.tx.currIParam, iRet);
CHKmalloc(iparams = malloc(sizeof(actWrkrIParams_t) * wrkrInfo->p.tx.currIParam));
CHKmalloc(iparams = malloc(sizeof(actWrkrIParams_t) * pThis->iNumTpls
* wrkrInfo->p.tx.currIParam));
needfree_iparams = 1;
actionTryRemoveHardErrorsFromBatch(pThis, pWti, iparams, &nMsgs);
}
@ -1561,7 +1570,7 @@ static rsRetVal setActionQueType(void __attribute__((unused)) *pVal, uchar *pszT
cs.ActionQueType = QUEUETYPE_DIRECT;
DBGPRINTF("action queue type set to DIRECT (no queueing at all)\n");
} else {
errmsg.LogError(0, RS_RET_INVALID_PARAMS, "unknown actionqueue parameter: %s", (char *) pszType);
LogError(0, RS_RET_INVALID_PARAMS, "unknown actionqueue parameter: %s", (char *) pszType);
iRet = RS_RET_INVALID_PARAMS;
}
d_free(pszType); /* no longer needed */
@ -1736,9 +1745,9 @@ DEFFUNC_llExecFunc(doActivateActions)
BEGINfunc
localRet = qqueueStart(pThis->pQueue);
if(localRet != RS_RET_OK) {
errmsg.LogError(0, localRet, "error starting up action queue");
LogError(0, localRet, "error starting up action queue");
if(localRet == RS_RET_FILE_PREFIX_MISSING) {
errmsg.LogError(0, localRet, "file prefix (work directory?) "
LogError(0, localRet, "file prefix (work directory?) "
"is missing");
}
actionDisable(pThis);
@ -1926,15 +1935,16 @@ addAction(action_t **ppAction, modInfo_t *pMod, void *pModData,
" Could not find template %d '%s' - action disabled",
i, pTplName);
errno = 0;
errmsg.LogError(0, RS_RET_NOT_FOUND, "%s", errMsg);
LogError(0, RS_RET_NOT_FOUND, "%s", errMsg);
ABORT_FINALIZE(RS_RET_NOT_FOUND);
}
/* check required template options */
if( (iTplOpts & OMSR_RQD_TPL_OPT_SQL)
&& (pAction->ppTpl[i]->optFormatEscape == 0)) {
errno = 0;
errmsg.LogError(0, RS_RET_RQD_TPLOPT_MISSING, "Action disabled. To use this action, you have to specify "
"the SQL or stdSQL option in your template!\n");
LogError(0, RS_RET_RQD_TPLOPT_MISSING, "Action disabled."
" To use this action, you have to specify "
"the SQL or stdSQL option in your template!\n");
ABORT_FINALIZE(RS_RET_RQD_TPLOPT_MISSING);
}
}
@ -2032,7 +2042,7 @@ actionNewInst(struct nvlst *lst, action_t **ppAction)
cnfparamsPrint(&pblk, paramvals);
cnfModName = (uchar*)es_str2cstr(paramvals[cnfparamGetIdx(&pblk, ("type"))].val.d.estr, NULL);
if((pMod = module.FindWithCnfName(loadConf, cnfModName, eMOD_OUT)) == NULL) {
errmsg.LogError(0, RS_RET_MOD_UNKNOWN, "module name '%s' is unknown", cnfModName);
LogError(0, RS_RET_MOD_UNKNOWN, "module name '%s' is unknown", cnfModName);
ABORT_FINALIZE(RS_RET_MOD_UNKNOWN);
}
CHKiRet(pMod->mod.om.newActInst(cnfModName, lst, &pModData, &pOMSR));
@ -2059,7 +2069,6 @@ rsRetVal actionClassInit(void)
CHKiRet(objGetObjInterface(&obj)); /* this provides the root pointer for all other queries */
CHKiRet(objUse(datetime, CORE_COMPONENT));
CHKiRet(objUse(module, CORE_COMPONENT));
CHKiRet(objUse(errmsg, CORE_COMPONENT));
CHKiRet(objUse(statsobj, CORE_COMPONENT));
CHKiRet(objUse(ruleset, CORE_COMPONENT));

6
compat/Makefile.in

@ -252,14 +252,16 @@ LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@
LIBLZ4_CFLAGS = @LIBLZ4_CFLAGS@
LIBLZ4_LIBS = @LIBLZ4_LIBS@
LIBM = @LIBM@
LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@
LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@
LIBMONGOC_CFLAGS = @LIBMONGOC_CFLAGS@
LIBMONGOC_LIBS = @LIBMONGOC_LIBS@
LIBOBJS = @LIBOBJS@
LIBRDKAFKA_CFLAGS = @LIBRDKAFKA_CFLAGS@
LIBRDKAFKA_LIBS = @LIBRDKAFKA_LIBS@
LIBS = @LIBS@
LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@
LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@
LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@
LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
LIBTOOL = @LIBTOOL@
LIBUUID_CFLAGS = @LIBUUID_CFLAGS@
LIBUUID_LIBS = @LIBUUID_LIBS@

3
config.h.in

@ -138,6 +138,9 @@
/* Define to 1 if you have the <librdkafka/rdkafka.h> header file. */
#undef HAVE_LIBRDKAFKA_RDKAFKA_H
/* libsystemd present */
#undef HAVE_LIBSYSTEMD
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H

205
configure

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for rsyslog 8.30.0.
# Generated by GNU Autoconf 2.69 for rsyslog 8.31.0.
#
# Report bugs to <rsyslog@lists.adiscon.com>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='rsyslog'
PACKAGE_TARNAME='rsyslog'
PACKAGE_VERSION='8.30.0'
PACKAGE_STRING='rsyslog 8.30.0'
PACKAGE_VERSION='8.31.0'
PACKAGE_STRING='rsyslog 8.31.0'
PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com'
PACKAGE_URL=''
@ -671,8 +671,8 @@ CZMQ_LIBS
CZMQ_CFLAGS
ENABLE_OMMONGODB_FALSE
ENABLE_OMMONGODB_TRUE
LIBMONGO_CLIENT_LIBS
LIBMONGO_CLIENT_CFLAGS
LIBMONGOC_LIBS
LIBMONGOC_CFLAGS
ENABLE_IMKAFKA_FALSE
ENABLE_IMKAFKA_TRUE
ENABLE_OMKAFKA_FALSE
@ -885,6 +885,8 @@ ZLIB_LIBS
ZLIB_CFLAGS
ENABLE_REGEXP_FALSE
ENABLE_REGEXP_TRUE
LIBSYSTEMD_LIBS
LIBSYSTEMD_CFLAGS
moddirs
WITH_MODDIRS_FALSE
WITH_MODDIRS_TRUE
@ -1156,6 +1158,8 @@ LIBESTR_CFLAGS
LIBESTR_LIBS
LIBFASTJSON_CFLAGS
LIBFASTJSON_LIBS
LIBSYSTEMD_CFLAGS
LIBSYSTEMD_LIBS
ZLIB_CFLAGS
ZLIB_LIBS
LIBSYSTEMD_JOURNAL_CFLAGS
@ -1184,8 +1188,8 @@ LIBRDKAFKA_CFLAGS
LIBRDKAFKA_LIBS
LIBLZ4_CFLAGS
LIBLZ4_LIBS
LIBMONGO_CLIENT_CFLAGS
LIBMONGO_CLIENT_LIBS
LIBMONGOC_CFLAGS
LIBMONGOC_LIBS
CZMQ_CFLAGS
CZMQ_LIBS
RABBITMQ_CFLAGS
@ -1744,7 +1748,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures rsyslog 8.30.0 to adapt to many kinds of systems.
\`configure' configures rsyslog 8.31.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1815,7 +1819,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of rsyslog 8.30.0:";;
short | recursive ) echo "Configuration of rsyslog 8.31.0:";;
esac
cat <<\_ACEOF
@ -2001,6 +2005,10 @@ Some influential environment variables:
C compiler flags for LIBFASTJSON, overriding pkg-config
LIBFASTJSON_LIBS
linker flags for LIBFASTJSON, overriding pkg-config
LIBSYSTEMD_CFLAGS
C compiler flags for LIBSYSTEMD, overriding pkg-config
LIBSYSTEMD_LIBS
linker flags for LIBSYSTEMD, overriding pkg-config
ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config
ZLIB_LIBS linker flags for ZLIB, overriding pkg-config
LIBSYSTEMD_JOURNAL_CFLAGS
@ -2049,10 +2057,10 @@ Some influential environment variables:
LIBLZ4_CFLAGS
C compiler flags for LIBLZ4, overriding pkg-config
LIBLZ4_LIBS linker flags for LIBLZ4, overriding pkg-config
LIBMONGO_CLIENT_CFLAGS
C compiler flags for LIBMONGO_CLIENT, overriding pkg-config
LIBMONGO_CLIENT_LIBS
linker flags for LIBMONGO_CLIENT, overriding pkg-config
LIBMONGOC_CFLAGS
C compiler flags for LIBMONGOC, overriding pkg-config
LIBMONGOC_LIBS
linker flags for LIBMONGOC, overriding pkg-config
CZMQ_CFLAGS C compiler flags for CZMQ, overriding pkg-config
CZMQ_LIBS linker flags for CZMQ, overriding pkg-config
RABBITMQ_CFLAGS
@ -2133,7 +2141,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
rsyslog configure 8.30.0
rsyslog configure 8.31.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2713,7 +2721,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by rsyslog $as_me 8.30.0, which was
It was created by rsyslog $as_me 8.31.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3093,6 +3101,8 @@ if test "$unamestr" = "AIX"; then
fi
# AIXPORT END
# change to the one below if Travis has a timeout
#AM_INIT_AUTOMAKE([subdir-objects serial-tests])
am__api_version='1.15'
ac_aux_dir=
@ -3608,7 +3618,7 @@ fi
# Define the identity of the package.
PACKAGE='rsyslog'
VERSION='8.30.0'
VERSION='8.31.0'
cat >>confdefs.h <<_ACEOF
@ -17399,6 +17409,85 @@ case "${enable_largefile}" in
*) enable_largefile="yes" ;;
esac
# do we have libsystemd?
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSYSTEMD" >&5
$as_echo_n "checking for LIBSYSTEMD... " >&6; }
if test -n "$LIBSYSTEMD_CFLAGS"; then
pkg_cv_LIBSYSTEMD_CFLAGS="$LIBSYSTEMD_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5
($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBSYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBSYSTEMD_LIBS"; then
pkg_cv_LIBSYSTEMD_LIBS="$LIBSYSTEMD_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5
($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBSYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBSYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd" 2>&1`
else
LIBSYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBSYSTEMD_PKG_ERRORS" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: libsystemd not present - disabling systemd support" >&5
$as_echo "$as_me: libsystemd not present - disabling systemd support" >&6;}
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: libsystemd not present - disabling systemd support" >&5
$as_echo "$as_me: libsystemd not present - disabling systemd support" >&6;}
else
LIBSYSTEMD_CFLAGS=$pkg_cv_LIBSYSTEMD_CFLAGS
LIBSYSTEMD_LIBS=$pkg_cv_LIBSYSTEMD_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define HAVE_LIBSYSTEMD 1" >>confdefs.h
fi
# Regular expressions
# Check whether --enable-regexp was given.
if test "${enable_regexp+set}" = set; then :
@ -20212,7 +20301,7 @@ else
ENABLE_RSYSLOGRT_FALSE=
fi
RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(LIBFASTJSON_CFLAGS)"
RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(LIBFASTJSON_CFLAGS) \$(LIBSYSTEMD_CFLAGS)"
if test "$GCC" = "yes"; then
RSRT_CFLAGS="$RSRT_CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute"
if $CC -Werror=implicit-function-declaration -x c -c /dev/null -o /dev/null 2>/dev/null; then
@ -20226,7 +20315,7 @@ if test "$GCC" = "yes"; then
fi
fi
RSRT_CFLAGS="$RSRT_CFLAGS $WARN_CFLAGS"
RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(LIBFASTJSON_LIBS)"
RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(LIBFASTJSON_LIBS) \$(LIBSYSTEMD_LIBS)"
@ -21225,12 +21314,12 @@ if test -n "$GT_KSI_LS12_CFLAGS"; then
pkg_cv_GT_KSI_LS12_CFLAGS="$GT_KSI_LS12_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libksi >= 3.13.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libksi >= 3.13.0") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libksi >= 3.16.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libksi >= 3.16.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GT_KSI_LS12_CFLAGS=`$PKG_CONFIG --cflags "libksi >= 3.13.0" 2>/dev/null`
pkg_cv_GT_KSI_LS12_CFLAGS=`$PKG_CONFIG --cflags "libksi >= 3.16.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -21242,12 +21331,12 @@ if test -n "$GT_KSI_LS12_LIBS"; then
pkg_cv_GT_KSI_LS12_LIBS="$GT_KSI_LS12_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libksi >= 3.13.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libksi >= 3.13.0") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libksi >= 3.16.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libksi >= 3.16.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GT_KSI_LS12_LIBS=`$PKG_CONFIG --libs "libksi >= 3.13.0" 2>/dev/null`
pkg_cv_GT_KSI_LS12_LIBS=`$PKG_CONFIG --libs "libksi >= 3.16.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -21268,14 +21357,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
GT_KSI_LS12_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libksi >= 3.13.0" 2>&1`
GT_KSI_LS12_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libksi >= 3.16.0" 2>&1`
else
GT_KSI_LS12_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libksi >= 3.13.0" 2>&1`
GT_KSI_LS12_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libksi >= 3.16.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GT_KSI_LS12_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (libksi >= 3.13.0) were not met:
as_fn_error $? "Package requirements (libksi >= 3.16.0) were not met:
$GT_KSI_LS12_PKG_ERRORS
@ -23637,7 +23726,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 23640 "configure" */
/* #line 23729 "configure" */
public class Test {
}
EOF
@ -23812,7 +23901,7 @@ EOF
if $UUDECODE Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
echo "configure: 23815: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: 23904: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@ -23929,7 +24018,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 23932 "configure" */
/* #line 24021 "configure" */
public class Test {
}
EOF
@ -23964,7 +24053,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
/* [#]line 23967 "configure" */
/* [#]line 24056 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);
@ -24134,19 +24223,19 @@ fi
if test "x$enable_ommongodb" = "xyes"; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBMONGO_CLIENT" >&5
$as_echo_n "checking for LIBMONGO_CLIENT... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBMONGOC" >&5
$as_echo_n "checking for LIBMONGOC... " >&6; }
if test -n "$LIBMONGO_CLIENT_CFLAGS"; then
pkg_cv_LIBMONGO_CLIENT_CFLAGS="$LIBMONGO_CLIENT_CFLAGS"
if test -n "$LIBMONGOC_CFLAGS"; then
pkg_cv_LIBMONGOC_CFLAGS="$LIBMONGOC_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmongo-client >= 0.1.4\""; } >&5
($PKG_CONFIG --exists --print-errors "libmongo-client >= 0.1.4") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmongoc-1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libmongoc-1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBMONGO_CLIENT_CFLAGS=`$PKG_CONFIG --cflags "libmongo-client >= 0.1.4" 2>/dev/null`
pkg_cv_LIBMONGOC_CFLAGS=`$PKG_CONFIG --cflags "libmongoc-1.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -24154,16 +24243,16 @@ fi
else
pkg_failed=untried
fi
if test -n "$LIBMONGO_CLIENT_LIBS"; then
pkg_cv_LIBMONGO_CLIENT_LIBS="$LIBMONGO_CLIENT_LIBS"
if test -n "$LIBMONGOC_LIBS"; then
pkg_cv_LIBMONGOC_LIBS="$LIBMONGOC_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmongo-client >= 0.1.4\""; } >&5
($PKG_CONFIG --exists --print-errors "libmongo-client >= 0.1.4") 2>&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmongoc-1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libmongoc-1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBMONGO_CLIENT_LIBS=`$PKG_CONFIG --libs "libmongo-client >= 0.1.4" 2>/dev/null`
pkg_cv_LIBMONGOC_LIBS=`$PKG_CONFIG --libs "libmongoc-1.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@ -24184,22 +24273,22 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBMONGO_CLIENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libmongo-client >= 0.1.4" 2>&1`
LIBMONGOC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libmongoc-1.0" 2>&1`
else
LIBMONGO_CLIENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libmongo-client >= 0.1.4" 2>&1`
LIBMONGOC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libmongoc-1.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBMONGO_CLIENT_PKG_ERRORS" >&5
echo "$LIBMONGOC_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (libmongo-client >= 0.1.4) were not met:
as_fn_error $? "Package requirements (libmongoc-1.0) were not met:
$LIBMONGO_CLIENT_PKG_ERRORS
$LIBMONGOC_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBMONGO_CLIENT_CFLAGS
and LIBMONGO_CLIENT_LIBS to avoid the need to call pkg-config.
Alternatively, you may set the environment variables LIBMONGOC_CFLAGS
and LIBMONGOC_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@ -24210,15 +24299,15 @@ as_fn_error $? "The pkg-config script could not be found or is too old. Make su
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables LIBMONGO_CLIENT_CFLAGS
and LIBMONGO_CLIENT_LIBS to avoid the need to call pkg-config.
Alternatively, you may set the environment variables LIBMONGOC_CFLAGS
and LIBMONGOC_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See \`config.log' for more details" "$LINENO" 5; }
else
LIBMONGO_CLIENT_CFLAGS=$pkg_cv_LIBMONGO_CLIENT_CFLAGS
LIBMONGO_CLIENT_LIBS=$pkg_cv_LIBMONGO_CLIENT_LIBS
LIBMONGOC_CFLAGS=$pkg_cv_LIBMONGOC_CFLAGS
LIBMONGOC_LIBS=$pkg_cv_LIBMONGOC_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@ -25514,8 +25603,6 @@ fi
# END TCL SUPPORT
# man pages
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if required man pages already exist..." >&5
$as_echo "$as_me: checking if required man pages already exist..." >&6;}
have_to_generate_man_pages="no"
git_src_have_to_generate_man_pages="yes" # default to use when building from git source
# Check whether --enable-generate-man-pages was given.
@ -25562,7 +25649,7 @@ if test "x$in_git_src" = "xyes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Running from git source" >&5
$as_echo "$as_me: Running from git source" >&6;}
have_to_generate_man_pages=git_src_have_to_generate_man_pages
have_to_generate_man_pages=$git_src_have_to_generate_man_pages
if test "x$LEX" != "xflex"; then
as_fn_error $? "flex program is needed to build rsyslog, please install flex." "$LINENO" 5
@ -26579,7 +26666,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by rsyslog $as_me 8.30.0, which was
This file was extended by rsyslog $as_me 8.31.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -26645,7 +26732,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
rsyslog config.status 8.30.0
rsyslog config.status 8.31.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

21
configure.ac

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([rsyslog],[8.30.0],[rsyslog@lists.adiscon.com])
AC_INIT([rsyslog],[8.31.0],[rsyslog@lists.adiscon.com])
# AIXPORT START: Detect the underlying OS
unamestr=$(uname)
@ -28,6 +28,8 @@ if test "$unamestr" = "AIX"; then
fi
# AIXPORT END
# change to the one below if Travis has a timeout
#AM_INIT_AUTOMAKE([subdir-objects serial-tests])
AM_INIT_AUTOMAKE([subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@ -284,6 +286,12 @@ case "${enable_largefile}" in
*) enable_largefile="yes" ;;
esac
# do we have libsystemd?
PKG_CHECK_MODULES([LIBSYSTEMD], [libsystemd],
[ AC_DEFINE(HAVE_LIBSYSTEMD, 1, [libsystemd present]) ],
[ AC_MSG_NOTICE([libsystemd not present - disabling systemd support]) ]
)
# Regular expressions
AC_ARG_ENABLE(regexp,
[AS_HELP_STRING([--enable-regexp],[Enable regular expressions support @<:@default=yes@:>@])],
@ -926,7 +934,7 @@ if test "x$enable_rsyslogrt" = "xyes"; then
RSRT_LIBS1="\$(top_builddir)/runtime/librsyslog.la"
fi
AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes)
RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(LIBFASTJSON_CFLAGS)"
RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(LIBFASTJSON_CFLAGS) \$(LIBSYSTEMD_CFLAGS)"
if test "$GCC" = "yes"; then
RSRT_CFLAGS="$RSRT_CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute"
if $CC -Werror=implicit-function-declaration -x c -c /dev/null -o /dev/null 2>/dev/null; then
@ -940,7 +948,7 @@ if test "$GCC" = "yes"; then
fi
fi
RSRT_CFLAGS="$RSRT_CFLAGS $WARN_CFLAGS"
RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(LIBFASTJSON_LIBS)"
RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(LIBFASTJSON_LIBS) \$(LIBSYSTEMD_LIBS)"
AC_SUBST(RSRT_CFLAGS1)
AC_SUBST(RSRT_LIBS1)
AC_SUBST(RSRT_CFLAGS)
@ -1292,7 +1300,7 @@ AC_ARG_ENABLE(ksi-ls12,
[enable_ksi_ls12=no]
)
if test "x$enable_ksi_ls12" = "xyes"; then
PKG_CHECK_MODULES(GT_KSI_LS12, libksi >= 3.13.0)
PKG_CHECK_MODULES(GT_KSI_LS12, libksi >= 3.16.0)
fi
AM_CONDITIONAL(ENABLE_KSI_LS12, test x$enable_ksi_ls12 = xyes)
@ -1793,7 +1801,7 @@ AC_ARG_ENABLE(ommongodb,
[enable_ommongodb=no]
)
if test "x$enable_ommongodb" = "xyes"; then
PKG_CHECK_MODULES(LIBMONGO_CLIENT, libmongo-client >= 0.1.4)
PKG_CHECK_MODULES(LIBMONGOC, libmongoc-1.0)
fi
AM_CONDITIONAL(ENABLE_OMMONGODB, test x$enable_ommongodb = xyes)
# end of mongodb code
@ -1994,7 +2002,6 @@ AM_CONDITIONAL(ENABLE_OMTCL, test x$enable_omtcl = xyes)
# END TCL SUPPORT
# man pages
AC_CHECKING([if required man pages already exist])
have_to_generate_man_pages="no"
git_src_have_to_generate_man_pages="yes" # default to use when building from git source
AC_ARG_ENABLE(generate-man-pages,
@ -2027,7 +2034,7 @@ AM_CONDITIONAL(ENABLE_DISTCHECK_WORKAROUND, test x$enable_distcheck_workaround =
if test "x$in_git_src" = "xyes"; then
AC_MSG_NOTICE([Running from git source])
have_to_generate_man_pages=git_src_have_to_generate_man_pages
have_to_generate_man_pages=$git_src_have_to_generate_man_pages
if test "x$LEX" != "xflex"; then
AC_MSG_ERROR([flex program is needed to build rsyslog, please install flex.])

6
contrib/imczmq/Makefile.in

@ -279,14 +279,16 @@ LIBLOGNORM_LIBS = @LIBLOGNORM_LIBS@
LIBLZ4_CFLAGS = @LIBLZ4_CFLAGS@
LIBLZ4_LIBS = @LIBLZ4_LIBS@
LIBM = @LIBM@
LIBMONGO_CLIENT_CFLAGS = @LIBMONGO_CLIENT_CFLAGS@
LIBMONGO_CLIENT_LIBS = @LIBMONGO_CLIENT_LIBS@
LIBMONGOC_CFLAGS = @LIBMONGOC_CFLAGS@
LIBMONGOC_LIBS = @LIBMONGOC_LIBS@
LIBOBJS = @LIBOBJS@
LIBRDKAFKA_CFLAGS = @LIBRDKAFKA_CFLAGS@
LIBRDKAFKA_LIBS = @LIBRDKAFKA_LIBS@
LIBS = @LIBS@
LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@
LIBSYSTEMD_JOURNAL_CFLAGS = @LIBSYSTEMD_JOURNAL_CFLAGS@
LIBSYSTEMD_JOURNAL_LIBS = @LIBSYSTEMD_JOURNAL_LIBS@
LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
LIBTOOL = @LIBTOOL@
LIBUUID_CFLAGS = @LIBUUID_CFLAGS@
LIBUUID_LIBS = @LIBUUID_LIBS@

54
contrib/imczmq/imczmq.c

@ -43,7 +43,6 @@ MODULE_TYPE_NOKEEP
MODULE_CNFNAME("imczmq");
DEF_IMOD_STATIC_DATA
DEFobjCurrIf(errmsg)
DEFobjCurrIf(glbl)
DEFobjCurrIf(prop)
DEFobjCurrIf(ruleset)
@ -138,13 +137,13 @@ static rsRetVal addListener(instanceConf_t* iconf){
DEFiRet;
DBGPRINTF("imczmq: addListener called..\n");
struct listener_t* pData;
struct listener_t* pData = NULL;
CHKmalloc(pData=(struct listener_t*)MALLOC(sizeof(struct listener_t)));
pData->ruleset = iconf->pBindRuleset;
pData->sock = zsock_new(iconf->sockType);
if(!pData->sock) {
errmsg.LogError(0, RS_RET_NO_ERRCODE,
LogError(0, RS_RET_NO_ERRCODE,
"imczmq: new socket failed for endpoints: %s",
iconf->sockEndpoints);
ABORT_FINALIZE(RS_RET_NO_ERRCODE);
@ -157,7 +156,7 @@ static rsRetVal addListener(instanceConf_t* iconf){
DBGPRINTF("imczmq: we are a CURVESERVER\n");
zcert_t *serverCert = zcert_load(runModConf->serverCertPath);
if(!serverCert) {
errmsg.LogError(0, NO_ERRCODE, "could not load cert %s",
LogError(0, NO_ERRCODE, "could not load cert %s",
runModConf->serverCertPath);
ABORT_FINALIZE(RS_RET_ERR);
}
@ -170,7 +169,7 @@ static rsRetVal addListener(instanceConf_t* iconf){
DBGPRINTF("imczmq: we are a CURVECLIENT\n");
zcert_t *serverCert = zcert_load(runModConf->serverCertPath);
if(!serverCert) {
errmsg.LogError(0, NO_ERRCODE, "could not load cert %s",
LogError(0, NO_ERRCODE, "could not load cert %s",
runModConf->serverCertPath);
ABORT_FINALIZE(RS_RET_ERR);
}
@ -180,7 +179,7 @@ static rsRetVal addListener(instanceConf_t* iconf){
zcert_t *clientCert = zcert_load(runModConf->clientCertPath);
if(!clientCert) {
errmsg.LogError(0, NO_ERRCODE, "could not load cert %s",
LogError(0, NO_ERRCODE, "could not load cert %s",
runModConf->clientCertPath);
ABORT_FINALIZE(RS_RET_ERR);
}
@ -233,7 +232,7 @@ static rsRetVal addListener(instanceConf_t* iconf){
else if(iconf->sockType == ZMQ_DISH) {
int rc = zsock_join (pData->sock, topic);
if(rc != 0) {
errmsg.LogError(0, NO_ERRCODE, "could not join group %s", topic);
LogError(0, NO_ERRCODE, "could not join group %s", topic);
ABORT_FINALIZE(RS_RET_ERR);
}
}
@ -248,7 +247,7 @@ static rsRetVal addListener(instanceConf_t* iconf){
int rc = zsock_attach(pData->sock, (const char*)iconf->sockEndpoints,
iconf->serverish);
if (rc == -1) {
errmsg.LogError(0, NO_ERRCODE, "zsock_attach to %s failed",
LogError(0, NO_ERRCODE, "zsock_attach to %s failed",
iconf->sockEndpoints);
ABORT_FINALIZE(RS_RET_ERR);
}
@ -257,26 +256,28 @@ static rsRetVal addListener(instanceConf_t* iconf){
rc = zlist_append(listenerList, (void *)pData);
if(rc != 0) {
errmsg.LogError(0, NO_ERRCODE, "could not append listener");
LogError(0, NO_ERRCODE, "could not append listener");
ABORT_FINALIZE(RS_RET_ERR);
}
finalize_it:
if(iRet != RS_RET_OK) {
free(pData);
}
RETiRet;
}
static rsRetVal rcvData(){
static rsRetVal rcvData(void){
DEFiRet;
if(!listenerList) {
listenerList = zlist_new();
if(!listenerList) {
errmsg.LogError(0, NO_ERRCODE, "could not allocate list");
LogError(0, NO_ERRCODE, "could not allocate list");
ABORT_FINALIZE(RS_RET_ERR);
}
}
zactor_t *authActor;
zcert_t *serverCert;
zactor_t *authActor = NULL;
if(runModConf->authenticator == 1) {
authActor = zactor_new(zauth, NULL);
@ -291,7 +292,7 @@ static rsRetVal rcvData(){
zpoller_t *poller = zpoller_new(NULL);
if(!poller) {
errmsg.LogError(0, NO_ERRCODE, "could not create poller");
LogError(0, NO_ERRCODE, "could not create poller");
ABORT_FINALIZE(RS_RET_ERR);
}
DBGPRINTF("imczmq: created poller\n");
@ -300,7 +301,7 @@ static rsRetVal rcvData(){
pData = zlist_first(listenerList);
if(!pData) {
errmsg.LogError(0, NO_ERRCODE, "imczmq: no listeners were "
LogError(0, NO_ERRCODE, "imczmq: no listeners were "
"started, input not activated.\n");
ABORT_FINALIZE(RS_RET_NO_RUN);
}
@ -308,7 +309,7 @@ static rsRetVal rcvData(){
while(pData) {
int rc = zpoller_add(poller, pData->sock);
if(rc != 0) {
errmsg.LogError(0, NO_ERRCODE, "imczmq: could not add "
LogError(0, NO_ERRCODE, "imczmq: could not add "
"socket to poller, input not activated.\n");
ABORT_FINALIZE(RS_RET_NO_RUN);
}
@ -365,15 +366,12 @@ finalize_it:
}
zlist_destroy(&listenerList);
zactor_destroy(&authActor);
zcert_destroy(&serverCert);
RETiRet;
}
BEGINrunInput
CODESTARTrunInput
CHKiRet(rcvData());
finalize_it:
RETiRet;
iRet = rcvData();
ENDrunInput
@ -400,7 +398,6 @@ ENDafterRun
BEGINmodExit
CODESTARTmodExit
objRelease(errmsg, CORE_COMPONENT);
objRelease(glbl, CORE_COMPONENT);
objRelease(prop, CORE_COMPONENT);
objRelease(ruleset, CORE_COMPONENT);
@ -432,7 +429,7 @@ BEGINsetModCnf
CODESTARTsetModCnf
pvals = nvlstGetParams(lst, &modpblk, NULL);
if(NULL == pvals) {
errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS,
LogError(0, RS_RET_MISSING_CNFPARAMS,
"imczmq: error processing module "
"config parameters ['module(...)']");