From aafa9b41a5f06b88f11df5c837427e171e1048d7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 1 Mar 2012 12:16:59 +0100 Subject: bugfix: imklog invalidly computed facility and severity closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313 --- ChangeLog | 4 ++++ plugins/imklog/imklog.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index be4f97c8..76a4686f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ --------------------------------------------------------------------------- +Version 5.9.6 [V5-DEVEL], 2012-03-?? +- bugfix: imklog invalidly computed facility and severity + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313 +--------------------------------------------------------------------------- Version 5.9.5 [V5-DEVEL], 2012-01-27 - improved impstats subsystem, added many new counters - enhanced module loader to not rely on PATH_MAX diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c index 40249273..e82dd1f4 100644 --- a/plugins/imklog/imklog.c +++ b/plugins/imklog/imklog.c @@ -119,8 +119,8 @@ enqMsg(uchar *msg, uchar* pszTag, int iFacility, int iSeverity, struct timeval * MsgSetRcvFromIP(pMsg, pLocalHostIP); MsgSetHOSTNAME(pMsg, glbl.GetLocalHostName(), ustrlen(glbl.GetLocalHostName())); MsgSetTAG(pMsg, pszTag, ustrlen(pszTag)); - pMsg->iFacility = LOG_FAC(iFacility); - pMsg->iSeverity = LOG_PRI(iSeverity); + pMsg->iFacility = iFacility; + pMsg->iSeverity = iSeverity; CHKiRet(submitMsg(pMsg)); finalize_it: -- cgit v1.2.3 From 2c7604f45b1c416180794f2c4f29ba25504f8d47 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 12 Mar 2012 17:01:44 +0100 Subject: cosmetic: removed stray definition --- tools/syslogd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/syslogd.c b/tools/syslogd.c index 92c539c7..33330a95 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -2725,7 +2725,6 @@ int realMain(int argc, char **argv) CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_aliases[i])); } else { CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_name)); - int i; } if((p = (uchar*)strchr((char*)LocalHostName, '.'))) -- cgit v1.2.3 From c64203c7f2c886712c33c21de7e0e53b7939a883 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sat, 7 Apr 2012 15:10:21 +0200 Subject: permit size modifiers (k,m,g,...) in integer config parameters Thanks to Jo Rhett for the suggestion. --- ChangeLog | 2 ++ doc/rsyslog_conf_global.html | 4 +-- runtime/cfsysline.c | 69 ++++++++++++++++++++++++-------------------- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index 35ff376d..524d9bfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 5.9.6 [V5-DEVEL], 2012-03-?? +- permit size modifiers (k,m,g,...) in integer config parameters + Thanks to Jo Rhett for the suggestion. - bugfix: imklog invalidly computed facility and severity closes: http://bugzilla.adiscon.com/show_bug.cgi?id=313 - added configuration directive to disable octet-counted framing diff --git a/doc/rsyslog_conf_global.html b/doc/rsyslog_conf_global.html index e24b0c15..8cfdd303 100644 --- a/doc/rsyslog_conf_global.html +++ b/doc/rsyslog_conf_global.html @@ -317,7 +317,7 @@ not be reset.
  • $UMASK
  • -

    Where <size_nbr> is specified above, +

    Where <size_nbr> or integers are specified above, modifiers can be used after the number part. For example, 1k means 1024. Supported are k(ilo), m(ega), g(iga), t(era), p(eta) and e(xa). Lower case letters refer to the traditional binary defintion (e.g. 1m @@ -325,7 +325,7 @@ equals 1,048,576) whereas upper case letters refer to their new 1000-based definition (e.g 1M equals 1,000,000).

    Numbers may include '.' and ',' for readability. So you can for example specify either "1000" or "1,000" with the same result. -Please note that rsyslogd simply ignores the punctuation. Form it's +Please note that rsyslogd simply ignores the punctuation. From it's point of view, "1,,0.0.,.,0" also has the value 1000.

    [manual index] diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c index 4997e0fb..36e586c1 100644 --- a/runtime/cfsysline.c +++ b/runtime/cfsysline.c @@ -154,36 +154,6 @@ finalize_it: } -/* Parse a number from the configuration line. - * rgerhards, 2007-07-31 - */ -static rsRetVal doGetInt(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *pVal) -{ - uchar *p; - DEFiRet; - int64 i; - - assert(pp != NULL); - assert(*pp != NULL); - - CHKiRet(parseIntVal(pp, &i)); - p = *pp; - - if(pSetHdlr == NULL) { - /* we should set value directly to var */ - *((int*)pVal) = (int) i; - } else { - /* we set value via a set function */ - CHKiRet(pSetHdlr(pVal, (int) i)); - } - - *pp = p; - -finalize_it: - RETiRet; -} - - /* Parse a size from the configuration line. This is basically an integer * syntax, but modifiers may be added after the integer (e.g. 1k to mean * 1024). The size must immediately follow the number. Note that the @@ -237,7 +207,44 @@ finalize_it: } -/* Parse and interpet a $FileCreateMode and $umask line. This function +/* Parse a number from the configuration line. + * rgerhards, 2007-07-31 + */ +static rsRetVal doGetInt(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *pVal) +{ + uchar *p; + DEFiRet; + int64 i; + uchar errMsg[256]; /* for dynamic error messages */ + + assert(pp != NULL); + assert(*pp != NULL); + + CHKiRet(doGetSize(pp, NULL,&i)); + p = *pp; + if(i > 2147483648ll) { /*2^31*/ + snprintf((char*) errMsg, sizeof(errMsg)/sizeof(uchar), + "value %lld too large for integer argument.", i); + errmsg.LogError(0, RS_RET_INVALID_VALUE, "%s", errMsg); + ABORT_FINALIZE(RS_RET_INVALID_VALUE); + } + + if(pSetHdlr == NULL) { + /* we should set value directly to var */ + *((int*)pVal) = (int) i; + } else { + /* we set value via a set function */ + CHKiRet(pSetHdlr(pVal, (int) i)); + } + + *pp = p; + +finalize_it: + RETiRet; +} + + +/* Parse and interpret a $FileCreateMode and $umask line. This function * pulls the creation mode and, if successful, stores it * into the global variable so that the rest of rsyslogd * opens files with that mode. Any previous value will be -- cgit v1.2.3