From f5638ea86a8626b7e0e471d720359cb4e3d8cb1c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sat, 6 Jul 2013 00:13:29 +0200 Subject: Imported Upstream version 7.4.2 --- ChangeLog | 31 +++++++++++++ Makefile.am | 1 + Makefile.in | 1 + configure | 22 +++++----- configure.ac | 4 +- doc/imfile.html | 6 +-- doc/imjournal.html | 2 +- doc/imptcp.html | 14 +++--- doc/imudp.html | 4 +- doc/manual.html | 2 +- doc/multi_ruleset.html | 2 +- doc/multi_ruleset_legacy_format.html | 2 +- doc/omfile.html | 72 +++++++++++++++---------------- doc/rsconf1_rulesetcreatemainqueue.html | 2 +- grammar/rainerscript.c | 11 ++++- plugins/imfile/imfile.c | 4 +- plugins/impstats/impstats.c | 4 ++ plugins/imptcp/imptcp.c | 5 +-- plugins/imtcp/imtcp.c | 4 +- plugins/imudp/imudp.c | 8 +--- plugins/omelasticsearch/omelasticsearch.c | 1 - plugins/omrelp/omrelp.c | 5 ++- runtime/lmsig_gt.c | 10 ++++- runtime/msg.c | 30 +++++++++++-- runtime/net.c | 1 + runtime/stream.c | 1 - runtime/strmsrv.h | 2 +- runtime/typedefs.h | 13 +++++- tcpsrv.h | 4 +- tests/diag.sh | 1 + 30 files changed, 172 insertions(+), 97 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8250a92..d02a218 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,35 @@ --------------------------------------------------------------------------- +Version 7.4.2 [v7.4-stable] 2013-07-04 +- bugfix: in RFC5425 TLS, multiple wildcards in auth could cause segfault +- bugfix: RainerScript object required parameters were not properly + checked - this clould result to segfaults on startup if parameters + were missing. +- bugfix: double-free in omelasticsearch + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=461 + a security advisory for this bug is available at: + http://www.lsexperts.de/advisories/lse-2013-07-03.txt + PLEASE NOTE: This issue only existed if omelasticsearch was used + in a non-default configuration, where the "errorfile" parameter + was specified. Without that parameter set, the bug could not + be triggered. + Thanks to Markus Vervier and Marius Ionescu for providing a detailled + bug report. Special thanks to Markus for coordinating his security + advisory with us. +- bugfix: omrelp potential segfault at startup on invalid config parameters +- bugfix: small memory leak when $uptime property was used +- bugfix: potential segfault on rsyslog termination in imudp + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=456 +- bugfix: lmsig_gt abort on invalid configuration parameters + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=448 + Thanks to Risto Laanoja for the patch. +- imtcp: fix typo in "listner" parameter, which is "listener" + Currently, both names are accepted. +- solved build problems on FreeBSD + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=457 + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=458 + Thanks to Christiano for reproting and suggesting patches +- solved build problems on CENTOS5 +--------------------------------------------------------------------------- Version 7.4.1 [v7.4-stable] 2013-06-17 - imjournal: add ratelimiting capability The original imjournal code did not support ratelimiting at all. We diff --git a/Makefile.am b/Makefile.am index ed3b54b..567b876 100644 --- a/Makefile.am +++ b/Makefile.am @@ -286,6 +286,7 @@ DISTCHECK_CONFIGURE_FLAGS= --enable-gssapi_krb5 \ --enable-pmsnare \ --enable-mmsnmptrapd \ --enable-elasticsearch \ + --enable-valgrind \ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) # temporarily disable these checks for make distcheck 2012-09-06 rgerhards # --enable-extended-tests \ diff --git a/Makefile.in b/Makefile.in index 9577fea..9232c11 100644 --- a/Makefile.in +++ b/Makefile.in @@ -599,6 +599,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gssapi_krb5 \ --enable-pmsnare \ --enable-mmsnmptrapd \ --enable-elasticsearch \ + --enable-valgrind \ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) all: config.h diff --git a/configure b/configure index 4f78940..8b9ef3d 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for rsyslog 7.4.1. +# Generated by GNU Autoconf 2.69 for rsyslog 7.4.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='rsyslog' PACKAGE_TARNAME='rsyslog' -PACKAGE_VERSION='7.4.1' -PACKAGE_STRING='rsyslog 7.4.1' +PACKAGE_VERSION='7.4.2' +PACKAGE_STRING='rsyslog 7.4.2' PACKAGE_BUGREPORT='rsyslog@lists.adiscon.com' PACKAGE_URL='' @@ -1612,7 +1612,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 7.4.1 to adapt to many kinds of systems. +\`configure' configures rsyslog 7.4.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1682,7 +1682,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rsyslog 7.4.1:";; + short | recursive ) echo "Configuration of rsyslog 7.4.2:";; esac cat <<\_ACEOF @@ -1929,7 +1929,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rsyslog configure 7.4.1 +rsyslog configure 7.4.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2509,7 +2509,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 7.4.1, which was +It was created by rsyslog $as_me 7.4.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3333,7 +3333,7 @@ fi # Define the identity of the package. PACKAGE='rsyslog' - VERSION='7.4.1' + VERSION='7.4.2' cat >>confdefs.h <<_ACEOF @@ -18422,7 +18422,7 @@ fi if test "x$enable_cached_man_pages" = "xno"; then # obtain path for rst2man if test "x$enable_libgcrypt" = "xyes" || \ - "x$enable_guardtime" = "xyes"; then + test "x$enable_guardtime" = "xyes"; then # Extract the first word of "rst2man", so it can be a program name with args. set dummy rst2man; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -20624,7 +20624,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 7.4.1, which was +This file was extended by rsyslog $as_me 7.4.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20690,7 +20690,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 7.4.1 +rsyslog config.status 7.4.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index bb0de0c..db324c7 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[7.4.1],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[7.4.2],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -1008,7 +1008,7 @@ AC_ARG_ENABLE(cached_man_pages, if test "x$enable_cached_man_pages" = "xno"; then # obtain path for rst2man if test "x$enable_libgcrypt" = "xyes" || \ - "x$enable_guardtime" = "xyes"; then + test "x$enable_guardtime" = "xyes"; then AC_PATH_PROG([RST2MAN], [rst2man]) if test "x${RST2MAN}" == "x"; then AC_MSG_FAILURE([rst2man not found in PATH]) diff --git a/doc/imfile.html b/doc/imfile.html index 274d6e6..dd62c86 100644 --- a/doc/imfile.html +++ b/doc/imfile.html @@ -14,7 +14,7 @@ a syslog message. A standard text file is a file consisting of printable characters with lines being delimited by LF.

The file is read line-by-line and any line read is passed to -rsyslog's rule engine. The rule engine applies filter conditons and +rsyslog's rule engine. The rule engine applies filter conditions and selects which actions needs to be carried out. Empty lines are not processed, as they would result in empty syslog records. They are simply ignored.

@@ -49,9 +49,9 @@ releases of imfile may support per-file polling intervals, but currently this is not the case. If multiple PollingInterval statements are present in rsyslog.conf, only the last one is used.
A short poll interval provides more rapid message forwarding, but -requires more system ressources. While it is possible, we stongly +requires more system resources. While it is possible, we stongly recommend not to set the polling interval to 0 seconds. That will make -rsyslogd become a CPU hog, taking up considerable ressources. It is +rsyslogd become a CPU hog, taking up considerable resources. It is supported, however, for the few very unusual situations where this level may be needed. Even if you need quick response, 1 seconds should be well enough. Please note that imfile keeps reading files as long as diff --git a/doc/imjournal.html b/doc/imjournal.html index 28b4701..a4b232e 100644 --- a/doc/imjournal.html +++ b/doc/imjournal.html @@ -30,7 +30,7 @@ probably resulting in a denial-of-service when the system ressouces get exhausted. This can be somewhat mitigated by using proper rate-limiters, but even then there are spikes of old data which are endlessly repeated. By default, ratelimiting is activated and permits to process 20,000 messages within 10 -seconds, what should be well enough for most use cases. If insufficient, use +minutes, what should be well enough for most use cases. If insufficient, use the parameters described below to adjust the permitted volume. It is strongly recommended to use this plugin only if there is hard need to do so. diff --git a/doc/imptcp.html b/doc/imptcp.html index b5bd097..aece428 100644 --- a/doc/imptcp.html +++ b/doc/imptcp.html @@ -31,7 +31,10 @@ globaly to all inputs defined by the module. Number of helper worker threads to process incoming messages. These threads are utilized to pull data off the network. On a busy system, additional helper threads (but not more than there are CPUs/Cores) can help improving -performance. The default value is two. +performance. The default value is two, which means there +is a default thread count of three (the main input thread plus two +helpers). +No more than 16 threads can be set (if tried to, rsyslog always resorts to 16).

Input Parameters:

These parameters can be used with the "input()" statement. They apply to the @@ -135,11 +138,8 @@ Equivalent to: Port Equivalent to: Name

  • $InputPTCPServerBindRuleset <name>
    Equivalent to: Ruleset
  • -
  • $InputPTCPHelperThreads <number>
    -Number of helper worker threads to process incoming messages. These -threads are utilized to pull data off the network. On a busy system, additional -helper threads (but not more than there are CPUs/Cores) can help improving -performance. The default value is two. +
  • $InputPTCPServerHelperThreads <number>
    +Equivalent to: threads
  • $InputPTCPServerListenIP <name>
    Equivalent to: Address
  • @@ -159,7 +159,7 @@ $InputPTCPServerRun 514

    This documentation is part of the rsyslog project.
    -Copyright © 2010-2012 by Rainer +Copyright © 2010-2013 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.

    diff --git a/doc/imudp.html b/doc/imudp.html index 6c94953..a8dbca3 100644 --- a/doc/imudp.html +++ b/doc/imudp.html @@ -72,7 +72,7 @@ the default of "imudp" is used and the port is appended to that default. So, for example, a listner port of 514 in that case will lead to an inputname of "imudp514". The ability to append a port is most useful when multiple ports are defined for a single input and each of the inputnames shall be unique. -Note that there currently is no differentiation between IPv4/v6 listners on +Note that there currently is no differentiation between IPv4/v6 listeners on the same port. @@ -91,7 +91,7 @@ user account. input(type="imudp" port="514") -

    In the next example, we set up three listners at ports 10514, 10515 and 10516 +

    In the next example, we set up three listeners at ports 10514, 10515 and 10516 and assign a listner name of "udp" to it, followed by the port number:



    Legacy Configuration Directives:

    diff --git a/doc/rsconf1_rulesetcreatemainqueue.html b/doc/rsconf1_rulesetcreatemainqueue.html index 5c1e0de..d09f95c 100644 --- a/doc/rsconf1_rulesetcreatemainqueue.html +++ b/doc/rsconf1_rulesetcreatemainqueue.html @@ -58,7 +58,7 @@ mail.* /var/log/mail10516 # being written to the remote10516 file - as usual... *.* /var/log/remote10516 -# and now define listners bound to the relevant ruleset +# and now define listeners bound to the relevant ruleset $InputTCPServerBindRuleset remote10514 $InputTCPServerRun 10514 diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 89cf946..95972fb 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -938,8 +938,14 @@ nvlstGetParams(struct nvlst *lst, struct cnfparamblk *params, for(i = 0 ; i < params->nParams ; ++i) { param = params->descr + i; - if((valnode = nvlstFindNameCStr(lst, param->name)) == NULL) + if((valnode = nvlstFindNameCStr(lst, param->name)) == NULL) { + if(param->flags & CNFPARAM_REQUIRED) { + parser_errmsg("parameter '%s' required but not specified - " + "fix config", param->name); + bInError = 1; + } continue; + } if(vals[i].bUsed) { parser_errmsg("parameter '%s' specified more than once - " "one instance is ignored. Fix config", param->name); @@ -950,7 +956,6 @@ nvlstGetParams(struct nvlst *lst, struct cnfparamblk *params, } } - if(bInError) { if(bValsWasNULL) cnfparamvalsDestruct(vals, params); @@ -3444,6 +3449,8 @@ void cnfparamvalsDestruct(struct cnfparamvals *paramvals, struct cnfparamblk *blk) { int i; + if(paramvals == NULL) + return; for(i = 0 ; i < blk->nParams ; ++i) { if(paramvals[i].bUsed) { varDelete(¶mvals[i].val); diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c index 349acea..2e80ffc 100644 --- a/plugins/imfile/imfile.c +++ b/plugins/imfile/imfile.c @@ -449,8 +449,6 @@ CODESTARTnewInpInst pvals = nvlstGetParams(lst, &inppblk, NULL); if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, - "imfile: required parameter are missing\n"); ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); } @@ -596,7 +594,7 @@ CODESTARTactivateCnf for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { addListner(inst); } - /* if we could not set up any listners, there is no point in running... */ + /* if we could not set up any listeners, there is no point in running... */ if(iFilPtr == 0) { errmsg.LogError(0, NO_ERRCODE, "imfile: no file monitors could be started, " "input not activated.\n"); diff --git a/plugins/impstats/impstats.c b/plugins/impstats/impstats.c index cdd205f..79749e2 100644 --- a/plugins/impstats/impstats.c +++ b/plugins/impstats/impstats.c @@ -29,6 +29,10 @@ #include #include #include +#if defined(__FreeBSD__) +#include +#endif + #include "dirty.h" #include "cfsysline.h" #include "module-template.h" diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c index 5c8bb67..906521d 100644 --- a/plugins/imptcp/imptcp.c +++ b/plugins/imptcp/imptcp.c @@ -1419,10 +1419,7 @@ BEGINnewInpInst CODESTARTnewInpInst DBGPRINTF("newInpInst (imptcp)\n"); - pvals = nvlstGetParams(lst, &inppblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, - "imptcp: required parameter are missing\n"); + if((pvals = nvlstGetParams(lst, &inppblk, NULL)) == NULL) { ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); } diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index fc22d45..2d9761c 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -141,6 +141,7 @@ static struct cnfparamdescr modpdescr[] = { { "addtlframedelimiter", eCmdHdlrPositiveInt, 0 }, { "maxsessions", eCmdHdlrPositiveInt, 0 }, { "maxlistners", eCmdHdlrPositiveInt, 0 }, + { "maxlisteners", eCmdHdlrPositiveInt, 0 }, { "streamdriver.mode", eCmdHdlrPositiveInt, 0 }, { "streamdriver.authmode", eCmdHdlrString, 0 }, { "permittedpeer", eCmdHdlrArray, 0 }, @@ -453,7 +454,8 @@ CODESTARTsetModCnf loadModConf->iAddtlFrameDelim = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "maxsessions")) { loadModConf->iTCPSessMax = (int) pvals[i].val.d.n; - } else if(!strcmp(modpblk.descr[i].name, "maxlistners")) { + } else if(!strcmp(modpblk.descr[i].name, "maxlisteners") || + !strcmp(modpblk.descr[i].name, "maxlistners")) { /* keep old name for a while */ loadModConf->iTCPLstnMax = (int) pvals[i].val.d.n; } else if(!strcmp(modpblk.descr[i].name, "keepalive")) { loadModConf->bKeepAlive = (int) pvals[i].val.d.n; diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 7bf1473..312645b 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -746,10 +746,7 @@ BEGINnewInpInst CODESTARTnewInpInst DBGPRINTF("newInpInst (imudp)\n"); - pvals = nvlstGetParams(lst, &inppblk, NULL); - if(pvals == NULL) { - errmsg.LogError(0, RS_RET_MISSING_CNFPARAMS, - "imudp: required parameter are missing\n"); + if((pvals = nvlstGetParams(lst, &inppblk, NULL)) == NULL) { ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); } if(Debug) { @@ -872,7 +869,7 @@ CODESTARTactivateCnfPrePrivDrop for(inst = runModConf->root ; inst != NULL ; inst = inst->next) { addListner(inst); } - /* if we could not set up any listners, there is no point in running... */ + /* if we could not set up any listeners, there is no point in running... */ if(lcnfRoot == NULL) { errmsg.LogError(0, NO_ERRCODE, "imudp: no listeners could be started, " "input not activated.\n"); @@ -898,7 +895,6 @@ CODESTARTfreeCnf for(inst = pModConf->root ; inst != NULL ; ) { free(inst->pszBindPort); free(inst->pszBindAddr); - free(inst->pBindRuleset); free(inst->inputname); del = inst; inst = inst->next; diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c index 33e58c1..57abefd 100644 --- a/plugins/omelasticsearch/omelasticsearch.c +++ b/plugins/omelasticsearch/omelasticsearch.c @@ -483,7 +483,6 @@ writeDataError(instanceData *pData, cJSON **pReplyRoot, uchar *reqmsg) DBGPRINTF("omelasticsearch: error %d writing error file, write returns %lld\n", errno, (long long) wrRet); } - free(rendered); cJSON_Delete(errRoot); *pReplyRoot = NULL; /* tell caller not to delete once again! */ diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index ae65f40..3e35546 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -79,7 +79,7 @@ static struct cnfparamdescr actpdescr[] = { { "target", eCmdHdlrGetWord, 1 }, { "port", eCmdHdlrGetWord, 0 }, { "timeout", eCmdHdlrInt, 0 }, - { "template", eCmdHdlrGetWord, 1 } + { "template", eCmdHdlrGetWord, 0 } }; static struct cnfparamblk actpblk = { CNFPARAMBLK_VERSION, @@ -179,7 +179,8 @@ CODESTARTnewActInst CHKiRet(doCreateRelpClient(pData)); CODE_STD_FINALIZERnewActInst - cnfparamvalsDestruct(pvals, &actpblk); + if(pvals != NULL) + cnfparamvalsDestruct(pvals, &actpblk); ENDnewActInst BEGINisCompatibleWithFeature diff --git a/runtime/lmsig_gt.c b/runtime/lmsig_gt.c index e9194c7..116a48d 100644 --- a/runtime/lmsig_gt.c +++ b/runtime/lmsig_gt.c @@ -89,7 +89,11 @@ SetCnfParam(void *pT, struct nvlst *lst) int i; uchar *cstr; struct cnfparamvals *pvals; + DEFiRet; pvals = nvlstGetParams(lst, &pblk, NULL); + if(pvals == NULL) { + ABORT_FINALIZE(RS_RET_MISSING_CNFPARAMS); + } if(Debug) { dbgprintf("sig param blk in lmsig_gt:\n"); cnfparamsPrint(&pblk, pvals); @@ -120,8 +124,10 @@ SetCnfParam(void *pT, struct nvlst *lst) "param '%s'\n", pblk.descr[i].name); } } - cnfparamvalsDestruct(pvals, &pblk); - return RS_RET_OK; +finalize_it: + if(pvals != NULL) + cnfparamvalsDestruct(pvals, &pblk); + RETiRet; } diff --git a/runtime/msg.c b/runtime/msg.c index a5c5281..9d5fa88 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -2989,15 +2989,39 @@ uchar *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, break; case PROP_SYS_UPTIME: # ifndef HAVE_SYSINFO_UPTIME - /* An alternative on some systems (eg Solaris) is to scan - * /var/adm/utmpx for last boot time. - */ + /* An alternative on some systems (eg Solaris) is to scan + * /var/adm/utmpx for last boot time. + */ pRes = (uchar*) "UPTIME NOT available on this system"; *pbMustBeFreed = 0; + +# elif defined(__FreeBSD__) + + { + struct timespec tp; + + if(*pbMustBeFreed == 1) + free(pRes); + if((pRes = (uchar*) MALLOC(sizeof(uchar) * 32)) == NULL) { + RET_OUT_OF_MEMORY; + } + *pbMustBeFreed = 1; + + if(clock_gettime(CLOCK_UPTIME, &tp) == -1) { + *pPropLen = sizeof("**SYSCALL FAILED**") - 1; + return(UCHAR_CONSTANT("**SYSCALL FAILED**")); + } + + snprintf((char*) pRes, sizeof(uchar) * 32, "%ld", tp.tv_sec); + } + # else + { struct sysinfo s_info; + if(*pbMustBeFreed == 1) + free(pRes); if((pRes = (uchar*) MALLOC(sizeof(uchar) * 32)) == NULL) { RET_OUT_OF_MEMORY; } diff --git a/runtime/net.c b/runtime/net.c index b291213..13391cc 100644 --- a/runtime/net.c +++ b/runtime/net.c @@ -232,6 +232,7 @@ finalize_it: /* enqueue the element */ if(pPeer->pWildcardRoot == NULL) { pPeer->pWildcardRoot = pNew; + pPeer->pWildcardLast = pNew; } else { pPeer->pWildcardLast->pNext = pNew; } diff --git a/runtime/stream.c b/runtime/stream.c index b781324..54210e4 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -67,7 +67,6 @@ # define O_LARGEFILE 0 #endif #ifndef HAVE_LSEEK64 - typedef off_t off64_t; # define lseek64(fd, offset, whence) lseek(fd, offset, whence) #endif diff --git a/runtime/strmsrv.h b/runtime/strmsrv.h index 9ef28e4..f3d56d1 100644 --- a/runtime/strmsrv.h +++ b/runtime/strmsrv.h @@ -43,7 +43,7 @@ struct strmsrv_s { uchar *pszInputName; /**< value to be used as input name */ permittedPeers_t *pPermPeers;/**< driver's permitted peers */ int iLstnMax; /**< max nbr of listeners currently supported */ - netstrm_t **ppLstn; /**< our netstream listners */ + netstrm_t **ppLstn; /**< our netstream listeners */ strmLstnPortList_t **ppLstnPort; /**< pointer to relevant listen port description */ int iSessMax; /**< max number of sessions supported */ strmLstnPortList_t *pLstnPorts; /**< head pointer for listen ports */ diff --git a/runtime/typedefs.h b/runtime/typedefs.h index 5cc24e4..d3f68b4 100644 --- a/runtime/typedefs.h +++ b/runtime/typedefs.h @@ -3,7 +3,7 @@ * * Begun 2010-11-25 RGerhards * - * Copyright (C) 2005-2008 by Rainer Gerhards and Adiscon GmbH + * Copyright (C) 2005-2013 by Rainer Gerhards and Adiscon GmbH * * This file is part of the rsyslog runtime library. * @@ -25,6 +25,13 @@ */ #ifndef INCLUDED_TYPEDEFS_H #define INCLUDED_TYPEDEFS_H +#if defined(__FreeBSD__) +#include +#endif + +#ifndef HAVE_LSEEK64 +#include +#endif /* some universal fixed size integer defines ... */ typedef long long int64; @@ -148,6 +155,10 @@ typedef enum { FIOP_ISEMPTY = 6 /* string empty <=> strlen(s) == 0 ?*/ } fiop_t; +#ifndef HAVE_LSEEK64 + typedef off_t off64_t; +#endif + /* types of configuration handlers */ typedef enum cslCmdHdlrType { diff --git a/tcpsrv.h b/tcpsrv.h index 93e472c..c9d491d 100644 --- a/tcpsrv.h +++ b/tcpsrv.h @@ -63,9 +63,9 @@ struct tcpsrv_s { sbool bUsingEPoll; /**< are we in epoll mode (means we do not need to keep track of sessions!) */ sbool bUseFlowControl; /**< use flow control (make light delayable) */ int iLstnCurr; /**< max nbr of listeners currently supported */ - netstrm_t **ppLstn; /**< our netstream listners */ + netstrm_t **ppLstn; /**< our netstream listeners */ tcpLstnPortList_t **ppLstnPort; /**< pointer to relevant listen port description */ - int iLstnMax; /**< max number of listners supported */ + int iLstnMax; /**< max number of listeners supported */ int iSessMax; /**< max number of sessions supported */ tcpLstnPortList_t *pLstnPorts; /**< head pointer for listen ports */ diff --git a/tests/diag.sh b/tests/diag.sh index 2fdcbfb..7883d93 100755 --- a/tests/diag.sh +++ b/tests/diag.sh @@ -109,6 +109,7 @@ case $1 in echo Shutting down instance 2 fi $srcdir/diag.sh wait-queueempty $2 + ./msleep 100 # wait 100 milliseconds kill `cat rsyslog$2.pid` # note: we do not wait for the actual termination! ;; -- cgit v1.2.3