Browse Source

New upstream version 8.27.0

upstream upstream/8.27.0
Michael Biebl 5 years ago
parent
commit
c82fd0231c
  1. 2
      .tarball-version
  2. 175
      ChangeLog
  3. 6
      Makefile.am
  4. 59
      Makefile.in
  5. 2
      README.md
  6. 34
      action.c
  7. 2
      compat/Makefile.am
  8. 14
      compat/Makefile.in
  9. 2
      compat/getifaddrs.c
  10. 15
      compat/ifaddrs.h
  11. 28
      compat/solaris_elf_fix.c
  12. 15
      config.h.in
  13. 1042
      configure
  14. 213
      configure.ac
  15. 1
      contrib/imczmq/Makefile.in
  16. 8
      contrib/imczmq/imczmq.c
  17. 1
      contrib/imkmsg/Makefile.in
  18. 1
      contrib/imzmq3/Makefile.in
  19. 1
      contrib/mmcount/Makefile.in
  20. 1
      contrib/mmdblookup/Makefile.in
  21. 1
      contrib/mmgrok/Makefile.in
  22. 1
      contrib/mmrfc5424addhmac/Makefile.in
  23. 1
      contrib/mmsequence/Makefile.in
  24. 1
      contrib/omamqp1/Makefile.in
  25. 1
      contrib/omczmq/Makefile.in
  26. 1
      contrib/omhiredis/Makefile.in
  27. 1
      contrib/omhttpfs/Makefile.in
  28. 1
      contrib/omrabbitmq/Makefile.in
  29. 1
      contrib/omtcl/Makefile.in
  30. 1
      contrib/omzmq3/Makefile.in
  31. 1
      contrib/pmaixforwardedfrom/Makefile.in
  32. 1
      contrib/pmcisconames/Makefile.in
  33. 1
      contrib/pmpanngfw/Makefile.in
  34. 1
      contrib/pmsnare/Makefile.in
  35. 1
      grammar/Makefile.in
  36. 2
      grammar/rainerscript.c
  37. 1
      plugins/im3195/Makefile.in
  38. 1
      plugins/imdiag/Makefile.in
  39. 1
      plugins/imdiag/imdiag.c
  40. 1
      plugins/imfile/Makefile.in
  41. 154
      plugins/imfile/imfile.c
  42. 1
      plugins/imgssapi/Makefile.in
  43. 1
      plugins/imjournal/Makefile.in
  44. 8
      plugins/imkafka/Makefile.am
  45. 750
      plugins/imkafka/Makefile.in
  46. 772
      plugins/imkafka/imkafka.c
  47. 1
      plugins/imklog/Makefile.in
  48. 1
      plugins/immark/Makefile.in
  49. 4
      plugins/immark/immark.c
  50. 1
      plugins/impstats/Makefile.in
  51. 1
      plugins/imptcp/Makefile.in
  52. 144
      plugins/imptcp/imptcp.c
  53. 1
      plugins/imrelp/Makefile.in
  54. 4
      plugins/imrelp/imrelp.c
  55. 1
      plugins/imsolaris/Makefile.in
  56. 1
      plugins/imtcp/Makefile.in
  57. 23
      plugins/imtcp/imtcp.c
  58. 1
      plugins/imudp/Makefile.in
  59. 1
      plugins/imuxsock/Makefile.in
  60. 25
      plugins/imuxsock/imuxsock.c
  61. 1
      plugins/mmanon/Makefile.in
  62. 1
      plugins/mmaudit/Makefile.in
  63. 1
      plugins/mmexternal/Makefile.in
  64. 2
      plugins/mmexternal/mmexternal.c
  65. 1
      plugins/mmfields/Makefile.in
  66. 1
      plugins/mmjsonparse/Makefile.in
  67. 1
      plugins/mmnormalize/Makefile.in
  68. 81
      plugins/mmnormalize/mmnormalize.c
  69. 1
      plugins/mmpstrucdata/Makefile.in
  70. 1
      plugins/mmrm1stspace/Makefile.in
  71. 1
      plugins/mmsnmptrapd/Makefile.in
  72. 1
      plugins/mmutf8fix/Makefile.in
  73. 1
      plugins/omelasticsearch/Makefile.in
  74. 1
      plugins/omgssapi/Makefile.in
  75. 1
      plugins/omhdfs/Makefile.in
  76. 1
      plugins/omjournal/Makefile.in
  77. 1
      plugins/omkafka/Makefile.in
  78. 37
      plugins/omkafka/omkafka.c
  79. 1
      plugins/omlibdbi/Makefile.in
  80. 1
      plugins/ommail/Makefile.in
  81. 1
      plugins/ommongodb/Makefile.in
  82. 1
      plugins/ommysql/Makefile.in
  83. 1
      plugins/ompgsql/Makefile.in
  84. 1
      plugins/omprog/Makefile.in
  85. 2
      plugins/omprog/omprog.c
  86. 1
      plugins/omrelp/Makefile.in
  87. 1
      plugins/omruleset/Makefile.in
  88. 1
      plugins/omsnmp/Makefile.in
  89. 6
      plugins/omsnmp/omsnmp.c
  90. 1
      plugins/omstdout/Makefile.in
  91. 1
      plugins/omtesting/Makefile.in
  92. 1
      plugins/omudpspoof/Makefile.in
  93. 1
      plugins/omuxsock/Makefile.in
  94. 1
      plugins/pmciscoios/Makefile.in
  95. 1
      plugins/pmlastmsg/Makefile.in
  96. 1
      plugins/pmnull/Makefile.in
  97. 18
      runtime/Makefile.am
  98. 87
      runtime/Makefile.in
  99. 5
      runtime/datetime.c
  100. 17
      runtime/glbl.c

2
.tarball-version

@ -1 +1 @@
8.25.0
8.27.0

175
ChangeLog

@ -1,4 +1,179 @@
------------------------------------------------------------------------------
Version 8.27.0 [v8-stable] 2017-05-16
- imkafka: add module
- imptcp enhancements:
* optionally emit an error message if incoming messages are truncated
* optionally emit connection tracking message (on connection create and
close)
* add "maxFrameSize" parameter to specify the maximum size permitted
in octet-counted mode
* add parameter "discardTruncatedMsg" to permit truncation of
oversize messages
* improve octect-counted mode detection: if the octet count is larger
then the set frame size (or overly large in general), it is now
assumed that octet-stuffing mode is used. This probably solves a
number of issues seen in real deployments.
- imtcp enhancements:
* add parameter "discardTruncatedMsg" to permit truncation of
oversize messages
* add "maxFrameSize" parameter to specify the maximum size permitted
in octet-counted mode
- imfile bugfix: "file not found error" repeatedly being reported
for configured non-existing file. In polling mode, this message
appeared once in each polling cycle, causing a potentially very large
amout of error messages. Note that they were usually emitted too
infrequently to trigger the error message rate limiter, albeit often
enough to be a major annoance.
- imfile: in inotify mode, add error message if configured file cannot
be found
- imfile: add parameter "fileNotFoundError" to optinally disable
"file not found" error messages
- core: replaced gethostbyname() with getaddrinfo() call
Gethostbyname() is generally considered obsolete, is not reentrant and
cannot really work with IPv6. Changed the only place in rsyslog where
this call remained.
Thanks to github user jvymazal for the patch
- omkafka: add "origin" field to stats output
See also https://github.com/rsyslog/rsyslog/issues/1508
Thanks to Yury Bushmelev for providing the patch.
- imuxsock: rate-limiting also uses process name
both for the actual limit procesing as well as warning messages emitted
see also https://github.com/rsyslog/rsyslog/pull/1520
Thanks to github user jvymazal for the patch
- Added new module: KSI log signing ver. 1.2 (lmsig_ksi_ls12)
- rsylsog base functionality now builds on osx (Mac)
Thanks to github user hdatma for his help in getting this done.
- build now works on solaris again
- imfile: fix cross-platform build issue
see also https://github.com/rsyslog/rsyslog/issues/1494
Thanks to Felix Janda for bug report and solution suggestion.
- bugfix core: segfault when no parser could parse message
This could happen if the default parser chain was changed and the
RFC3164 parser was not included. Never seen in practice, just by
experimenting in lab.
- bugfix core: rate-limit internal messages when going to external log system
Rate-limiting was only applied to messages processed internally.
While the external logging system probably also applies rate-limiting,
it would be preferrable that rsyslog applies the same policies on
internal messages, no matter where they go. This is now the case.
- bugfix core: when obtaining local hostname, a NULL pointer could be
accessed. This depends on many factors, among them that no local host
name is configured in rsyslog.conf AND the local system configuration
also is set to an empty hostname.
Thanks to github user jvymazal for the patch.
- bugfix core: on shutdown, stderr was written to, even if alrady closed
This lead to messages going to whatever was associated with file
descriptor two.
Thanks to Allan Park for the patch.
- bugfix core: perform MainqObj destruction only when not NULL already
This affects the config object; in theory may lead to misadressing during
config parsing.
Thanks to github user jvymazal for the patch
- bugfix core: memory leak when internal messages not processed internally
In this case, the message object is not destructed, resulting in
a memory leak. Usually, this is no problem due to the low number
of internal message, but it can become an issue if a large number
of messages is emitted.
closes https://github.com/rsyslog/rsyslog/issues/1548
closes https://github.com/rsyslog/rsyslog/issues/1531
- bugfix imptcp: potential overflow in octet count computation
when a very large octet count was specified, the counter could overflow
------------------------------------------------------------------------------
Version 8.26.0 [v8-stable] 2017-04-04
- NEW BUILD REQUIREMENT: liblognorm 2.0.3 is required for mmnormalize
If mmnormalize is not built, the build requirements are unchanged.
The new version is necessary because it contains an enhanced API for a
new mmnormalize feature.
- enable internal error messages at all times
This is an important change to the design of the rsyslog core internal
error message system. Previous code could deadlock if internal messages were
issued inside queue processing code, which effectively limited error-reporting
capabilities. This change makes it possible to call error messages from any
part of the code at any time.
As a side-effect, this also fixes an issue where rsyslog could deadlock if
imuxsock submited messages to the system log socket when that socket blocked.
This was a rare race, albeit consistently reproducible and also seen in
practice. The work-around for this issue was to set
global(processInternalMessages="on")
in rsyslog.conf. With the new code, this race can never happen again. The new
code also sets stage for emitting better error messages, especially in places
where we previously refrained from doing so and messages went only to the
debug log. For some file output and queue subsytem related messages, this
is already done, but there is still further work required.
Note well: this is a redesign of an important core component. While intensely
tested, this may still have some larger regeression potential than usual code
changes.
- core: added logging name of source of rate-limited messages
This adds the name to the rate-limiting message itself, making it easier
to identify the actual source of "spam" messages.
Thanks to github user jvymazal for the patch.
- omfwd: omfwd: add support for network namespaces
Thanks to Bastian Stender for the patch.
- imrelp: honor input name if provided when submitting to impstats
Thanks to Jon Henry for the patch.
- imptcp: add ability to set owner/group/access perms for uds
Thanks to Nathan Brown for implementing this feature.
- mmnormalize: add ability to load a rulebase from action() parameter
This is especially useful for small rulebases, as it avoids having
a separate rulebase file.
closes https://github.com/rsyslog/rsyslog/issues/625
- pmrfc3164 improvements
- permit to ignore leading space in MSG
- permit to use at-sign in host names
- permit to require tag to end in colon
Thanks to github user bdolez for the contribution
- add new global parameter "umask"
This is equivalent to "$umask" and permits to convert that construct
to new-style config format.
closes https://github.com/rsyslog/rsyslog/issues/1382
- core: make use of -T command line option more secure
When the -T option is used, a chdir is now done right after chroot. It must
be noted, though, that -T is a testing option and has no intent to provide
real security. So this change does not mean it actually is sufficiently
secure.
Thanks to github user jvymazal for the patch.
- omfile: add error if both file and dynafile are set
- bugfix: build problem on MacOS (not a supported platform)
Thanks to FX Coudert for the fix.
- regression fix: in 8.25, str2num() returned error on empty string
past behaviour was to return 0 in this case; past behavior was reinstanciated
Thanks to github user jvymazal for the patch.
- bugfix omsnmp: improper handling of new-style configuration parameters
Thanks to Radovan Sroka for the patch.
- bugfix: rsyslog identifies itself as "liblogging-stdlog" in internal messages
This occured when liblogging-stdlog was used, and was used by default (without
explicit configuration). This is a regression of the new default, which does
not correctly call stdlog_open() in the default case.
closes https://github.com/rsyslog/rsyslog/issues/1442
- bugfix imfile: wrong files were monitored when using multiple imfile inputs
The bug was introduced by the changes for the multilevel wildcard feature
in 8.25.0. We have to handle FileCreate events different if the directory
watch is configured or added dynamically.
closes https://github.com/rsyslog/rsyslog/issues/1452
- bugfix: setting net.aclResolveHostname/net.acladdhostnameonfail segfaults
When compiling using hardned gcc (gentoo), specifying net.aclResolveHostname
or net.acladdhostnameonfail results in rsyslogd segfaulting on startup.
Thanks to Radovan Sroka for the patch.
- bugfix: immark emitted error messages with text "imuxsock"
Thanks to Chris Pilkington for the patch.
- bugfix tcpflood: build failed if RELP was disabled
- fix gcc6 compiler warnings
This also fixes a small bug with incorrectly working deprecated -u
command line option.
Thanks to Nikola Pajkovsky for the patch.
- the output module array passing interface has been removed
It wasn't functional since the v8 update, and the only user was omoracle,
which is a contributed module that is no longer maintained. So we
removed that interface to streamline the code. Should it ever be needed
again, we could check the 8.25 code base. Note, though, that that code
still needs to be adjusted to the v8 engine.
- testbench:
* tcpflood now automatically enters silent mode during Travis CI testing
This reduces testbench output, which is limited under Travis.
* the libqpid-proton package is no longer available for Ubuntu trusty. As
such, we disabled its use in Travis on this platform. Right now, this
means omaqp1 module is no longer tested on trusty.
------------------------------------------------------------------------------
Version 8.25.0 [v8-stable] 2017-02-21
- imfile: add support for wildcards in directory names
This now permits to monitor newly created directories without altering

6
Makefile.am

@ -192,7 +192,11 @@ SUBDIRS += plugins/ommail
endif
if ENABLE_OMKAFKA
SUBDIRS += plugins/omkafka
SUBDIRS += plugins/omkafka
endif
if ENABLE_IMKAFKA
SUBDIRS += plugins/imkafka
endif
if ENABLE_OMPROG

59
Makefile.in

@ -129,31 +129,32 @@ sbin_PROGRAMS =
@ENABLE_IMPTCP_TRUE@am__append_36 = plugins/imptcp
@ENABLE_IMDIAG_TRUE@am__append_37 = plugins/imdiag
@ENABLE_MAIL_TRUE@am__append_38 = plugins/ommail
@ENABLE_OMKAFKA_TRUE@am__append_39 = plugins/omkafka
@ENABLE_OMPROG_TRUE@am__append_40 = plugins/omprog
@ENABLE_RFC3195_TRUE@am__append_41 = plugins/im3195
@ENABLE_MMNORMALIZE_TRUE@am__append_42 = plugins/mmnormalize
@ENABLE_MMJSONPARSE_TRUE@am__append_43 = plugins/mmjsonparse
@ENABLE_MMGROK_TRUE@am__append_44 = contrib/mmgrok
@ENABLE_MMAUDIT_TRUE@am__append_45 = plugins/mmaudit
@ENABLE_MMANON_TRUE@am__append_46 = plugins/mmanon
@ENABLE_MMRM1STSPACE_TRUE@am__append_47 = plugins/mmrm1stspace
@ENABLE_MMUTF8FIX_TRUE@am__append_48 = plugins/mmutf8fix
@ENABLE_MMCOUNT_TRUE@am__append_49 = contrib/mmcount
@ENABLE_MMSEQUENCE_TRUE@am__append_50 = contrib/mmsequence
@ENABLE_MMDBLOOKUP_TRUE@am__append_51 = contrib/mmdblookup
@ENABLE_MMFIELDS_TRUE@am__append_52 = plugins/mmfields
@ENABLE_MMPSTRUCDATA_TRUE@am__append_53 = plugins/mmpstrucdata
@ENABLE_MMRFC5424ADDHMAC_TRUE@am__append_54 = contrib/mmrfc5424addhmac
@ENABLE_OMKAFKA_TRUE@am__append_39 = plugins/omkafka
@ENABLE_IMKAFKA_TRUE@am__append_40 = plugins/imkafka
@ENABLE_OMPROG_TRUE@am__append_41 = plugins/omprog
@ENABLE_RFC3195_TRUE@am__append_42 = plugins/im3195
@ENABLE_MMNORMALIZE_TRUE@am__append_43 = plugins/mmnormalize
@ENABLE_MMJSONPARSE_TRUE@am__append_44 = plugins/mmjsonparse
@ENABLE_MMGROK_TRUE@am__append_45 = contrib/mmgrok
@ENABLE_MMAUDIT_TRUE@am__append_46 = plugins/mmaudit
@ENABLE_MMANON_TRUE@am__append_47 = plugins/mmanon
@ENABLE_MMRM1STSPACE_TRUE@am__append_48 = plugins/mmrm1stspace
@ENABLE_MMUTF8FIX_TRUE@am__append_49 = plugins/mmutf8fix
@ENABLE_MMCOUNT_TRUE@am__append_50 = contrib/mmcount
@ENABLE_MMSEQUENCE_TRUE@am__append_51 = contrib/mmsequence
@ENABLE_MMDBLOOKUP_TRUE@am__append_52 = contrib/mmdblookup
@ENABLE_MMFIELDS_TRUE@am__append_53 = plugins/mmfields
@ENABLE_MMPSTRUCDATA_TRUE@am__append_54 = plugins/mmpstrucdata
@ENABLE_MMRFC5424ADDHMAC_TRUE@am__append_55 = contrib/mmrfc5424addhmac
# omhttpfs
@ENABLE_OMHTTPFS_TRUE@am__append_55 = contrib/omhttpfs
@ENABLE_OMHTTPFS_TRUE@am__append_56 = contrib/omhttpfs
# omamqp1
@ENABLE_OMAMQP1_TRUE@am__append_56 = contrib/omamqp1
@ENABLE_OMAMQP1_TRUE@am__append_57 = contrib/omamqp1
# omtcl
@ENABLE_OMTCL_TRUE@am__append_57 = contrib/omtcl
@ENABLE_OMTCL_TRUE@am__append_58 = contrib/omtcl
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_define.m4 \
@ -274,17 +275,16 @@ DIST_SUBDIRS = compat runtime grammar . plugins/immark \
contrib/imzmq3 contrib/imczmq plugins/omuxsock plugins/omhdfs \
plugins/omjournal plugins/imjournal plugins/omelasticsearch \
plugins/mmsnmptrapd plugins/imfile plugins/imptcp \
plugins/imdiag plugins/ommail plugins/omkafka plugins/omprog \
plugins/im3195 plugins/mmnormalize plugins/mmjsonparse \
contrib/mmgrok plugins/mmaudit plugins/mmanon \
plugins/mmrm1stspace plugins/mmutf8fix contrib/mmcount \
contrib/mmsequence contrib/mmdblookup plugins/mmfields \
plugins/mmpstrucdata contrib/mmrfc5424addhmac contrib/omhttpfs \
contrib/omamqp1 contrib/omtcl tests
plugins/imdiag plugins/ommail plugins/omkafka plugins/imkafka \
plugins/omprog plugins/im3195 plugins/mmnormalize \
plugins/mmjsonparse contrib/mmgrok plugins/mmaudit \
plugins/mmanon plugins/mmrm1stspace plugins/mmutf8fix \
contrib/mmcount contrib/mmsequence contrib/mmdblookup \
plugins/mmfields plugins/mmpstrucdata contrib/mmrfc5424addhmac \
contrib/omhttpfs contrib/omamqp1 contrib/omtcl tests
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \
COPYING COPYING.LESSER ChangeLog INSTALL NEWS README compile \
config.guess config.sub depcomp install-sh ltmain.sh missing \
ylwrap
config.guess config.sub install-sh ltmain.sh missing ylwrap
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@ -375,6 +375,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@
@ -587,7 +588,7 @@ SUBDIRS = compat runtime grammar . plugins/immark plugins/imuxsock \
$(am__append_48) $(am__append_49) $(am__append_50) \
$(am__append_51) $(am__append_52) $(am__append_53) \
$(am__append_54) $(am__append_55) $(am__append_56) \
$(am__append_57) tests
$(am__append_57) $(am__append_58) tests
# make sure "make distcheck" tries to build all modules. This means that
# a developer must always have an environment where every supporting library

2
README.md

@ -74,7 +74,7 @@ Libraries in question are at least: libestr, liblognorm, libfastjson.
Needed packages to build with omhiredis support:
```
apt-get update && apt-get install -y build-essential pkg-config libestr-dev libfastjson-dev zlib1g-dev uuid-dev libgcrypt20-dev liblogging-stdlog-dev libhiredis-dev
apt-get update && apt-get install -y build-essential pkg-config libestr-dev libfastjson-dev zlib1g-dev uuid-dev libgcrypt20-dev liblogging-stdlog-dev libhiredis-dev uuid-dev libgcrypt11-dev liblogging-stdlog-dev flex bison
```
Aditional packages for other modules:

34
action.c

@ -982,10 +982,10 @@ prepareDoActionParams(action_t * __restrict__ const pAction,
&(pWrkrInfo->p.nontx.actParams[i]),
ttNow));
break;
case ACT_ARRAY_PASSING:
CHKiRet(tplToArray(pAction->ppTpl[i], pMsg,
(uchar***) &(pWrkrInfo->p.nontx.actParams[i].param), ttNow));
break;
/* note: ARRAY_PASSING mode has been removed in 8.26.0; if it
* is ever needed again, it can be found in 8.25.0.
* rgerhards 2017-03-06
*/
case ACT_MSG_PASSING:
pWrkrInfo->p.nontx.actParams[i].param = (void*) pMsg;
break;
@ -1013,10 +1013,8 @@ finalize_it:
void
releaseDoActionParams(action_t *__restrict__ const pAction, wti_t *__restrict__ const pWti, int action_destruct)
{
int jArr;
int j;
actWrkrInfo_t *__restrict__ pWrkrInfo;
uchar ***ppMsgs;
pWrkrInfo = &(pWti->actWrkrInfo[pAction->iActionNbr]);
for(j = 0 ; j < pAction->iNumTpls ; ++j) {
@ -1028,24 +1026,9 @@ releaseDoActionParams(action_t *__restrict__ const pAction, wti_t *__restrict__
} else {
switch(pAction->peParamPassing[j]) {
case ACT_ARRAY_PASSING:
ppMsgs = (uchar***) pWrkrInfo->p.nontx.actParams[0].param;
/* if we every use array passing mode again, we need to check
* this code. It hasn't been used since refactoring for v7.
*/
if(ppMsgs != NULL) {
if(((uchar**)ppMsgs)[j] != NULL) {
jArr = 0;
while(ppMsgs[j][jArr] != NULL) {
free(ppMsgs[j][jArr]);
ppMsgs[j][jArr] = NULL;
++jArr;
}
free(((uchar**)ppMsgs)[j]);
((uchar**)ppMsgs)[j] = NULL;
}
}
break;
LogError(0, RS_RET_ERR, "plugin error: no longer supported "
"ARRAY_PASSING mode is used (see action.c)");
return;
case ACT_JSON_PASSING:
json_object_put((struct json_object*)
pWrkrInfo->p.nontx.actParams[j].param);
@ -1900,8 +1883,7 @@ addAction(action_t **ppAction, modInfo_t *pMod, void *pModData,
/* set parameter-passing mode */
if(iTplOpts & OMSR_TPL_AS_ARRAY) {
pAction->peParamPassing[i] = ACT_ARRAY_PASSING;
pAction->bNeedReleaseBatch = 1;
ABORT_FINALIZE(RS_RET_ERR);
} else if(iTplOpts & OMSR_TPL_AS_MSG) {
pAction->peParamPassing[i] = ACT_MSG_PASSING;
pAction->bUsesMsgPassingMode = 1;

2
compat/Makefile.am

@ -1,6 +1,6 @@
noinst_LTLIBRARIES = compat.la
compat_la_SOURCES = getifaddrs.c ifaddrs.h strndup.c
compat_la_SOURCES = getifaddrs.c ifaddrs.h strndup.c solaris_elf_fix.c
compat_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
compat_la_LDFLAGS = -module -avoid-version
compat_la_LIBADD = $(IMUDP_LIBS)

14
compat/Makefile.in

@ -106,7 +106,8 @@ CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
am__DEPENDENCIES_1 =
compat_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_compat_la_OBJECTS = compat_la-getifaddrs.lo compat_la-strndup.lo
am_compat_la_OBJECTS = compat_la-getifaddrs.lo compat_la-strndup.lo \
compat_la-solaris_elf_fix.lo
compat_la_OBJECTS = $(am_compat_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@ -225,6 +226,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@
@ -385,7 +387,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = compat.la
compat_la_SOURCES = getifaddrs.c ifaddrs.h strndup.c
compat_la_SOURCES = getifaddrs.c ifaddrs.h strndup.c solaris_elf_fix.c
compat_la_CPPFLAGS = -I$(top_srcdir) $(PTHREADS_CFLAGS) $(RSRT_CFLAGS)
compat_la_LDFLAGS = -module -avoid-version
compat_la_LIBADD = $(IMUDP_LIBS)
@ -444,6 +446,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat_la-getifaddrs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat_la-solaris_elf_fix.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat_la-strndup.Plo@am__quote@
.c.o:
@ -484,6 +487,13 @@ compat_la-strndup.lo: strndup.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(compat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat_la-strndup.lo `test -f 'strndup.c' || echo '$(srcdir)/'`strndup.c
compat_la-solaris_elf_fix.lo: solaris_elf_fix.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(compat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compat_la-solaris_elf_fix.lo -MD -MP -MF $(DEPDIR)/compat_la-solaris_elf_fix.Tpo -c -o compat_la-solaris_elf_fix.lo `test -f 'solaris_elf_fix.c' || echo '$(srcdir)/'`solaris_elf_fix.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/compat_la-solaris_elf_fix.Tpo $(DEPDIR)/compat_la-solaris_elf_fix.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='solaris_elf_fix.c' object='compat_la-solaris_elf_fix.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(compat_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o compat_la-solaris_elf_fix.lo `test -f 'solaris_elf_fix.c' || echo '$(srcdir)/'`solaris_elf_fix.c
mostlyclean-libtool:
-rm -f *.lo

2
compat/getifaddrs.c

@ -47,10 +47,10 @@
#include <sys/types.h>
#include <stdlib.h>
#include <net/if.h>
#include <ifaddrs.h>
#if defined (_AIX)
#include <netinet/in6_var.h>
#endif
#include <ifaddrs.h>
/* Normally this is defined in <net/if.h> but was new for Solaris 11 */
#ifndef LIFC_ENABLED

15
compat/ifaddrs.h

@ -36,9 +36,13 @@ extern "C" {
* The `getifaddrs' function generates a linked list of these structures.
* Each element of the list describes one network interface.
*/
#if (defined(_INT64_TYPE)|| defined(_AIX))
#if defined(_AIX)
struct ifaddrs_rsys {
struct ifaddrs_rsys *ifa_next; /* Pointer to the next structure. */
#else
struct ifaddrs {
struct ifaddrs *ifa_next; /* Pointer to the next structure. */
#endif
char *ifa_name; /* Name of this network interface. */
uint64_t ifa_flags; /* Flags as from SIOCGLIFFLAGS ioctl. */
struct sockaddr *ifa_addr; /* Network address of this interface. */
@ -65,7 +69,6 @@ struct ifaddrs_rsys {
#define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of p-to-p link */
#endif
};
#endif
/*
* Create a linked list of `struct ifaddrs' structures, one for each
@ -75,10 +78,18 @@ struct ifaddrs_rsys {
* The storage returned in *ifap is allocated dynamically and can
* only be properly freed by passing it to `freeifaddrs'.
*/
#if defined(_AIX)
extern int getifaddrs(struct ifaddrs_rsys **);
#else
extern int getifaddrs(struct ifaddrs **);
#endif
/* Reclaim the storage allocated by a previous `getifaddrs' call. */
#if defined(_AIX)
extern void freeifaddrs(struct ifaddrs_rsys *);
#else
extern void freeifaddrs(struct ifaddrs *);
#endif
#ifdef __cplusplus

28
compat/solaris_elf_fix.c

@ -0,0 +1,28 @@
/* This file ensure that is at least one symbol in our compat
* convenience library. Otherwise, at least the Solaris linker
* bails out with an error message like this:
*
* ld: elf error: file ../compat/.libs/compat.a: elf_getarsym
*
* Copyright 2016 Rainer Gerhards and Adiscon
*
* This file is part of rsyslog.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* -or-
* see COPYING.ASL20 in the source distribution
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "config.h"
#ifdef OS_SOLARIS
int SOLARIS_wants_a_symbol_inside_the_lib;
#endif

15
config.h.in

@ -24,9 +24,6 @@
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
@ -132,6 +129,9 @@
/* Define to 1 if you have the <libgen.h> header file. */
#undef HAVE_LIBGEN_H
/* Define to 1 if you have the `ksi' library (-lksi). */
#undef HAVE_LIBKSI
/* Define to 1 if liblogging-stdlog is available. */
#undef HAVE_LIBLOGGING_STDLOG
@ -225,6 +225,9 @@
/* Define to 1 if you have the <semaphore.h> header file. */
#undef HAVE_SEMAPHORE_H
/* Define if setns exists. */
#undef HAVE_SETNS
/* Define to 1 if you have the `setsid' function. */
#undef HAVE_SETSID
@ -390,6 +393,9 @@
/* Indicator for a AIX OS */
#undef OS_AIX
/* Indicator for APPLE OS */
#undef OS_APPLE
/* Indicator for a BSD OS */
#undef OS_BSD
@ -465,9 +471,6 @@
/* Define if you want to enable libuuid support */
#undef USE_LIBUUID
/* Multithreading support enabled. */
#undef USE_PTHREADS
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE

1042
configure

File diff suppressed because it is too large

213
configure.ac

@ -2,14 +2,11 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([rsyslog],[8.25.0],[rsyslog@lists.adiscon.com])
AC_INIT([rsyslog],[8.27.0],[rsyslog@lists.adiscon.com])
# AIXPORT START: Detect the underlying OS
unamestr=$(uname)
AM_CONDITIONAL([AIX], [test x$unamestr = xAIX])
# AIXPORT END
# AIXPORT START : Set the required variables for AIX config script
if test "$unamestr" = "AIX"; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/pkgconfig"
LIBS="-lbsd -lsrc"
@ -55,23 +52,23 @@ fi
AC_PROG_LIBTOOL
AC_CANONICAL_HOST
m4_ifdef([AX_IS_RELEASE], [
AX_IS_RELEASE([git-directory])
m4_ifdef([AX_COMPILER_FLAGS], [
AX_COMPILER_FLAGS()
if test "$GCC" = "yes"
then
m4_ifdef([AX_IS_RELEASE], [
AX_IS_RELEASE([git-directory])
m4_ifdef([AX_COMPILER_FLAGS], [
AX_COMPILER_FLAGS()
], [
CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
AC_MSG_WARN([missing AX_COMPILER_FLAGS macro, not using it])
])
], [
if test "$GCC" = "yes"
then CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
fi
AC_MSG_WARN([missing AX_COMPILER_FLAGS macro, not using it])
CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
AC_MSG_WARN([missing AX_IS_RELEASE macro, not using AX_COMPILER_FLAGS macro because of this])
])
], [
if test "$GCC" = "yes"
then CFLAGS="$CFLAGS -W -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
fi
AC_MSG_WARN([missing AX_IS_RELEASE macro, not using AX_COMPILER_FLAGS macro because of this])
])
else
AC_MSG_WARN([compiler is not GCC or close compatible, not using ax_compiler_flags because of this (CC=$CC)])
fi
PKG_PROG_PKG_CONFIG
@ -84,6 +81,7 @@ AC_DEFINE_UNQUOTED([PLATFORM_ID], ["${host}"], [platform id for display purposes
# nice to have the extra information.
AC_DEFINE_UNQUOTED([PLATFORM_ID_LSB], ["`lsb_release -d`"], [platform id for display purposes])
echo HOST: ${host}
case "${host}" in
*-*-linux*)
AC_DEFINE([OS_LINUX], [1], [Indicator for a Linux OS])
@ -93,6 +91,10 @@ case "${host}" in
AC_DEFINE([OS_BSD], [1], [Indicator for a BSD OS])
os_type="bsd"
;;
*-apple-*)
AC_DEFINE([OS_APPLE], [1], [Indicator for APPLE OS])
os_type="apple"
;;
*-*-kfreebsd*)
# kernel is FreeBSD, but userspace is glibc - i.e. like linux
# do not DEFINE OS_BSD
@ -103,6 +105,8 @@ case "${host}" in
AC_DEFINE([OS_SOLARIS], [1], [Indicator for a Solaris OS])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS], [1], [Use POSIX pthread semantics])
AC_DEFINE([_XOPEN_SOURCE], [600], [Use X/Open CAE Specification])
CPPFLAGS="-std=c99 $CPPFLAGS"
CFLAGS="-std=c99 $CFLAGS"
SOL_LIBS="-lsocket -lnsl"
# Solaris libuuid does not ship with a pkgconfig file so override the appropriate
# variables (but only if they have not been set by the user).
@ -110,19 +114,19 @@ case "${host}" in
LIBUUID_LIBS=${LIBUUID_LIBS:=-luuid}
AC_SUBST(SOL_LIBS)
;;
# AIXPORT START
*-*-aix*)
os_type="aix"
AC_DEFINE([OS_AIX], [1], [Indicator for a AIX OS])
;;
# AIXPORT END
esac
AM_CONDITIONAL(OS_APPLE, test x$os_type == xapple)
AM_CONDITIONAL(xOS_LINUX, test x$os_type == xlinux)
AM_CONDITIONAL(OS_LINUX, test x$os_type == xlinux)
# Running from git source?
in_git_src=no
AS_IF([test -d "$srcdir"/.git && ! test -f "$srcdir"/.tarball-version], [in_git_src=yes])
AM_CONDITIONAL(OS_LINUX, test x$os_type == xlinux)
AC_DEFINE_UNQUOTED([HOSTENV], "$host", [the host environment, can be queried via a system variable])
@ -145,7 +149,25 @@ AC_SUBST(DL_LIBS)
AC_HEADER_RESOLV
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h libgen.h malloc.h fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h sys/inotify.h unistd.h utmp.h utmpx.h sys/epoll.h sys/prctl.h])
AC_CHECK_HEADER([arpa/inet.h],[],[],[
[#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
]
])
AC_CHECK_HEADERS([libgen.h],[],[],[
[#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif
]
])
AC_CHECK_HEADERS([malloc.h],[],[],[
[#ifdef HAVE_MALLOC_H
# include <malloc.h>
#endif
]
])
AC_CHECK_HEADERS([fcntl.h locale.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/stat.h sys/inotify.h unistd.h utmp.h utmpx.h sys/epoll.h sys/prctl.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@ -179,6 +201,7 @@ AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([flock inotify_init recvmmsg basename alarm clock_gettime gethostbyname gethostname gettimeofday localtime_r memset mkdir regcomp select setsid socket strcasecmp strchr strdup strerror strndup strnlen strrchr strstr strtol strtoul uname ttyname_r getline malloc_trim prctl epoll_create epoll_create1 fdatasync syscall lseek64])
AC_CHECK_FUNC([setns], [AC_DEFINE([HAVE_SETNS], [1], [Define if setns exists.])])
AC_CHECK_TYPES([off64_t])
# getifaddrs is in libc (mostly) or in libsocket (eg Solaris 11) or not defined (eg Solaris 10)
@ -318,32 +341,34 @@ AM_CONDITIONAL(ENABLE_GSSAPI, test x$enable_gssapi_krb5 = xyes)
# multithreading via pthreads
AC_CHECK_HEADERS(
[pthread.h],
[
AC_CHECK_LIB(
[pthread],
[pthread_create],
[
AC_DEFINE([USE_PTHREADS], [1], [Multithreading support enabled.])
PTHREADS_LIBS="-lpthread"
if test "$unamestr" = "AIX"; then
PTHREADS_CFLAGS="-lpthreads"
else
case "${os_type}" in
solaris) PTHREADS_CFLAGS="-pthreads" ;;
*) PTHREADS_CFLAGS="-pthread" ;;
esac
fi
AC_SUBST(PTHREADS_LIBS)
AC_SUBST(PTHREADS_CFLAGS)
],
[AC_MSG_FAILURE([pthread is missing])],
[-lpthread]
)
],
[AC_MSG_FAILURE([pthread is missing])]
)
if test "$os_type" != "solaris"
then
AC_CHECK_HEADERS(
[pthread.h],
[
AC_CHECK_LIB(
[pthread],
[pthread_create],
[
PTHREADS_LIBS="-lpthread"
if test "$unamestr" = "AIX"; then
PTHREADS_CFLAGS="-lpthreads"
else
case "${os_type}" in
solaris) PTHREADS_CFLAGS="-pthreads -std=c99" ;;
*) PTHREADS_CFLAGS="-pthread" ;;
esac
fi
AC_SUBST(PTHREADS_LIBS)
AC_SUBST(PTHREADS_CFLAGS)
],
[AC_MSG_FAILURE([pthread is missing])],
[-lpthread]
)
],
[AC_MSG_FAILURE([pthread is missing])]
)
fi
AC_CHECK_LIB(
[pthread],
@ -1025,7 +1050,7 @@ AC_ARG_ENABLE(mmnormalize,
[enable_mmnormalize=no]
)
if test "x$enable_mmnormalize" = "xyes"; then
PKG_CHECK_MODULES(LIBLOGNORM, lognorm >= 1.1.2)
PKG_CHECK_MODULES(LIBLOGNORM, lognorm >= 2.0.3)
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
@ -1269,6 +1294,22 @@ fi
AM_CONDITIONAL(ENABLE_GT_KSI, test x$enable_gt_ksi = xyes)
# GuardTime KSI LOGSIG 12 support
AC_ARG_ENABLE(ksi-ls12,
[AS_HELP_STRING([--enable-ksi-ls12],[Enable log file signing support via GuardTime KSI LS12 @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_ksi_ls12="yes" ;;
no) enable_ksi_ls12="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ksi-ls12) ;;
esac],
[enable_ksi_ls12=no]
)
if test "x$enable_ksi_ls12" = "xyes"; then
PKG_CHECK_MODULES(GT_KSI, libksi >= 3.13.0)
AC_CHECK_LIB([ksi], [KSI_Signature_signAggregatedWithPolicy], [], [AC_MSG_FAILURE([Could not find libksi])])
fi
AM_CONDITIONAL(ENABLE_KSI_LS12, test x$enable_ksi_ls12 = xyes)
# liblogging-stdlog support
AC_ARG_ENABLE(liblogging-stdlog,
[AS_HELP_STRING([--enable-liblogging-stdlog],[Enable liblogging-stdlog support @<:@default=yes@:>@])],
@ -1314,6 +1355,13 @@ AC_ARG_ENABLE(testbench,
esac],
[enable_testbench=no]
)
AC_CHECK_PROG(IP, [ip], [yes], [no])
if test "x${IP}" = "xno"; then
AC_MSG_NOTICE([Will not check network namespace functionality as 'ip' (part of iproute2) is not available.])
fi
AM_CONDITIONAL(ENABLE_IP, test "x${IP}" = "xyes")
AM_CONDITIONAL(ENABLE_TESTBENCH, test x$enable_testbench = xyes)
if test "x$enable_testbench" = "xyes"; then
if test "x$enable_imdiag" != "xyes"; then
@ -1614,10 +1662,9 @@ if test "x$enable_omhdfs"; then
fi
AM_CONDITIONAL(ENABLE_OMHDFS, test x$enable_omhdfs = xyes)
# support for omkafka
# support for kafka input output
AC_ARG_ENABLE(omkafka,
[AS_HELP_STRING([--enable-omkafka],[Compiles omkafka module @<:@default=no@:>@])],
[AS_HELP_STRING([--enable-omkafka],[Compiles kafka output module @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_omkafka="yes" ;;
no) enable_omkafka="no" ;;
@ -1625,6 +1672,16 @@ AC_ARG_ENABLE(omkafka,
esac],
[enable_omkafka=no]
)
AC_ARG_ENABLE(imkafka,
[AS_HELP_STRING([--enable-imkafka],[Compiles kafka input and output module @<:@default=no@:>@])],
[case "${enableval}" in
yes) enable_imkafka="yes" ;;
no) enable_imkafka="no" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-imkafka) ;;
esac],
[enable_imkafka=no]
)
AC_ARG_ENABLE(kafka_tests,
[AS_HELP_STRING([--enable-kafka-tests],[Enable Kafka tests, needs Java @<:@default=no@:>@])],
[case "${enableval}" in
@ -1636,7 +1693,32 @@ AC_ARG_ENABLE(kafka_tests,
)
AM_CONDITIONAL(ENABLE_KAFKA_TESTS, test x$enable_kafka_tests = xyes)
# omkafka works with older library
if test "x$enable_omkafka" = "xyes"; then
PKG_CHECK_MODULES([LIBRDKAFKA], [librdkafka],, [
AC_CHECK_LIB([rdkafka], [rd_kafka_produce], [
AC_MSG_WARN([librdkafka is missing but library present, using -lrdkafka])
LIBRDKAFKA_LIBS=-lrdkafka
], [
AC_MSG_ERROR([could not find rdkafka library])
])
])
AC_CHECK_HEADERS([librdkafka/rdkafka.h])
fi
# imkafka needs newer library
if test "x$enable_imkafka" = "xyes"; then
PKG_CHECK_MODULES(LIBRDKAFKA, rdkafka >= 0.9.1)
AC_CHECK_LIB([rdkafka], [rd_kafka_produce], [
AC_MSG_WARN([librdkafka is missing but library present, using -lrdkafka])
LIBRDKAFKA_LIBS=-lrdkafka
], [
AC_MSG_ERROR([could not find rdkafka library])
])
AC_CHECK_HEADERS([librdkafka/rdkafka.h])
fi
if test "x$enable_omkafka" = "xyes" && test "x$enable_imkafka" = "xyes"; then
if test "x$enable_kafka_tests" = "xyes"; then
AX_PROG_JAVAC #we don't need javac, but macro documentation says JAVAC *must* be checked before JAVA
AX_PROG_JAVA
@ -1649,21 +1731,14 @@ if test "x$enable_omkafka" = "xyes"; then
AC_MSG_FAILURE([readlink, which is a kafka-tests dependency, not found])
fi
fi
PKG_CHECK_MODULES([LIBRDKAFKA], [librdkafka],, [
AC_CHECK_LIB([rdkafka], [rd_kafka_produce], [
AC_MSG_WARN([librdkafka is missing but library present, using -lrdkafka])
LIBRDKAFKA_LIBS=-lrdkafka
], [
AC_MSG_ERROR([could not find rdkafka library])
])
])
AC_CHECK_HEADERS([librdkafka/rdkafka.h])
else
if test "x$enable_kafka_tests" = "xyes"; then
AC_MSG_ERROR([kafka-tests can not be enabled while omkafka is disabled])
AC_MSG_WARN([kafka-tests can not be enabled without omkafka and imkafka support. Disabling enable_kafka_tests...])
enable_kafka_tests="no"
fi
fi
AM_CONDITIONAL(ENABLE_OMKAFKA, test x$enable_omkafka = xyes)
AM_CONDITIONAL(ENABLE_IMKAFKA, test x$enable_imkafka = xyes)
#MONGODB SUPPORT
@ -1880,11 +1955,14 @@ AM_CONDITIONAL(ENABLE_OMTCL, test x$enable_omtcl = xyes)
# 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,
[AS_HELP_STRING([--enable-generate-man-pages],[Generate man pages from source @<:@default=no@:>@])],
[case "${enableval}" in
yes) have_to_generate_man_pages="yes" ;;
no) have_to_generate_man_pages="no" ;;
no) have_to_generate_man_pages="no" ;
git_src_have_to_generate_man_pages="no"
;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-generate-man-pages) ;;
esac],
[have_to_generate_man_pages=no]
@ -1908,7 +1986,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=yes
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.])
@ -1963,6 +2041,7 @@ AC_CONFIG_FILES([Makefile \
plugins/impstats/Makefile \
plugins/imrelp/Makefile \
plugins/imdiag/Makefile \
plugins/imkafka/Makefile \
plugins/omtesting/Makefile \
plugins/omgssapi/Makefile \
plugins/ommysql/Makefile \
@ -2019,6 +2098,7 @@ echo " Unlimited select() support enabled: $enable_unlimited_select"
echo " uuid support enabled: $enable_uuid"
echo " Log file signing support: $enable_guardtime"
echo " Log file signing support via KSI: $enable_gt_ksi"
echo " Log file signing support via KSI LS12: $enable_ksi_ls12"
echo " Log file encryption support: $enable_libgcrypt"
echo " anonymization support enabled: $enable_mmanon"
echo " mmrm1stspace module enabled: $enable_mmrm1stspace"
@ -2037,10 +2117,10 @@ echo " periodic statistics module enabled: $enable_impstats"
echo " imzmq3 input module enabled: $enable_imzmq3"
echo " imczmq input module enabled: $enable_imczmq"
echo " imjournal input module enabled: $enable_imjournal"
echo " imkafka module will be compiled: $enable_imkafka"
echo
echo "---{ output plugins }---"
echo " Mail support enabled: $enable_mail"
echo " omkafka module will be compiled: $enable_omkafka"
echo " omprog module will be compiled: $enable_omprog"
echo " omstdout module will be compiled: $enable_omstdout"
echo " omjournal module will be compiled: $enable_omjournal"
@ -2055,6 +2135,7 @@ echo " omrabbitmq module will be compiled: $enable_omrabbitmq"
echo " omhttpfs module will be compiled: $enable_omhttpfs"
echo " omamqp1 module will be compiled: $enable_omamqp1"
echo " omtcl module will be compiled: $enable_omtcl"
echo " omkafka module will be compiled: $enable_omkafka"
echo
echo "---{ parser modules }---"
echo " pmlastmsg module will be compiled: $enable_pmlastmsg"

1
contrib/imczmq/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

8
contrib/imczmq/imczmq.c

@ -196,7 +196,7 @@ static rsRetVal addListener(instanceConf_t* iconf){
#if defined(ZMQ_DISH)
case ZMQ_DISH:
#endif
iconf->serverish = true;
iconf->serverish = false;
break;
case ZMQ_PULL:
#if defined(ZMQ_GATHER)
@ -211,6 +211,12 @@ static rsRetVal addListener(instanceConf_t* iconf){
}
if(iconf->topics) {
// A zero-length topic means subscribe to everything
if(!*iconf->topics && iconf->sockType == ZMQ_SUB) {
DBGPRINTF("imczmq: subscribing to all topics\n");
zsock_set_subscribe(pData->sock, "");
}
char topic[256];
while(*iconf->topics) {
char *delimiter = strchr(iconf->topics, ',');

1
contrib/imkmsg/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/imzmq3/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/mmcount/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/mmdblookup/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/mmgrok/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/mmrfc5424addhmac/Makefile.in

@ -255,6 +255,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/mmsequence/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/omamqp1/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/omczmq/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/omhiredis/Makefile.in

@ -254,6 +254,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/omhttpfs/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/omrabbitmq/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/omtcl/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/omzmq3/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/pmaixforwardedfrom/Makefile.in

@ -254,6 +254,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/pmcisconames/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/pmpanngfw/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
contrib/pmsnare/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
grammar/Makefile.in

@ -240,6 +240,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

2
grammar/rainerscript.c

@ -1279,7 +1279,7 @@ str2num(es_str_t *s, int *bSuccess)
if(s->lenStr == 0) {
DBGPRINTF("rainerscript: str2num: strlen == 0; invalid input (no string)\n");
if(bSuccess != NULL) {
*bSuccess = 0;
*bSuccess = 1;
}
goto done;
}

1
plugins/im3195/Makefile.in

@ -253,6 +253,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
plugins/imdiag/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

1
plugins/imdiag/imdiag.c

@ -315,6 +315,7 @@ waitMainQEmpty(tcps_sess_t *pSess)
DEFiRet;
while(1) {
processImInternal();
if(iOverallQueueSize == 0)
++nempty;
else

1
plugins/imfile/Makefile.in

@ -252,6 +252,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IP = @IP@
JAVA = @JAVA@
JAVAC = @JAVAC@
JSON_C_CFLAGS = @JSON_C_CFLAGS@

154
plugins/imfile/imfile.c

@ -84,6 +84,20 @@ static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config para
#define ADD_METADATA_UNSPECIFIED -1
/*
* Helpers for wildcard in directory detection
*/
#define DIR_CONFIGURED 0
#define DIR_DYNAMIC 1
/* If set to 1, fileTableDisplay will be compiled and used for debugging */
#define ULTRA_DEBUG 0
/* Setting GLOB_BRACE to ZERO which disables support for GLOB_BRACE if not available on current platform */
#ifndef GLOB_BRACE
#define GLOB_BRACE 0
#endif
/* this structure is used in pure polling mode as well one of the support
* structures for inotify.
*/
@ -117,6 +131,7 @@ typedef struct lstn_s {
sbool addMetadata;
sbool addCeeTag;
sbool freshStartTail; /* read from tail of file on fresh start? */
sbool fileNotFoundError;
ruleset_t *pRuleset; /* ruleset to bind listener to (use system default if unspecified) */
ratelimit_t *ratelimiter;
multi_submit_t multiSub;
@ -156,6 +171,7 @@ struct instanceConf_s {
sbool addCeeTag;
sbool addMetadata;
sbool freshStartTail;
sbool fileNotFoundError;
int maxLinesAtOnce;
uint32_t trimLineOverBytes;
ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */
@ -217,6 +233,7 @@ typedef struct fileTable_s fileTable_t;
*/
struct dirInfo_s {
uchar *dirName;
int bDirType; /* Configured or dynamic */
fileTable_t active; /* associated active files */
fileTable_t configured; /* associated configured files */
};
@ -224,11 +241,11 @@ typedef struct dirInfo_s dirInfo_t;
static dirInfo_t *dirs = NULL;
static int allocMaxDirs;
static int currMaxDirs;
/* the following two macros are used to select the correct file table */
#define ACTIVE_FILE 1
#define CONFIGURED_FILE 0
/* We need to map watch descriptors to our actual objects. Unfortunately, the
* inotify API does not provide us with any cookie, so a simple O(1) algorithm
* cannot be done (what a shame...). We assume that maintaining the array is much
@ -286,7 +303,8 @@ static struct cnfparamdescr inppdescr[] = {
{ "addceetag", eCmdHdlrBinary, 0 },
{ "statefile", eCmdHdlrString, CNFPARAM_DEPRECATED },
{ "readtimeout", eCmdHdlrPositiveInt, 0 },
{ "freshstarttail", eCmdHdlrBinary, 0}
{ "freshstarttail", eCmdHdlrBinary, 0},
{ "filenotfounderror", eCmdHdlrBinary, 0}
};
static struct cnfparamblk inppblk =
{ CNFPARAMBLK_VERSION,
@ -578,6 +596,7 @@ openFileWithStateFile(lstn_t *const __restrict__ pLstn)
CHKiRet(strm.SettOperationsMode(psSF, STREAMMODE_READ));
CHKiRet(strm.SetsType(psSF, STREAMTYPE_FILE_SINGLE));
CHKiRet(strm.SetFName(psSF, pszSFNam, lenSFNam));
CHKiRet(strm.SetFileNotFoundError(psSF, pLstn->fileNotFoundError));
CHKiRet(strm.ConstructFinalize(psSF));
/* read back in the object */
@ -626,6 +645,7 @@ openFileWithoutStateFile(lstn_t *const __restrict__ pLstn)
CHKiRet(strm.SettOperationsMode(pLstn->pStrm, STREAMMODE_READ));
CHKiRet(strm.SetsType(pLstn->pStrm, STREAMTYPE_FILE_MONITOR));
CHKiRet(strm.SetFName(pLstn->pStrm, pLstn->pszFileName, strlen((char*) pLstn->pszFileName)));
CHKiRet(strm.SetFileNotFoundError(pLstn->pStrm, pLstn->fileNotFoundError));
CHKiRet(strm.ConstructFinalize(pLstn->pStrm));
/* As a state file not exist, this is a fresh start. seek to file end