From 09c61f9b09b7bb80590a507b8b9643aa11677b0a Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sun, 4 May 2008 10:45:43 +0200 Subject: preparigng for 3.17.2 release --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 865cfe84..f4a2599f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ -Version 3.17.2 (rgerhards), 2008-04-?? -- this version is the new beta +Version 3.17.2 (rgerhards), 2008-05-04 +- this version is the new beta, based on 3.17.1 devel feature set - merged in imklog bug fix from v3-stable (3.16.1) --------------------------------------------------------------------------- Version 3.17.1 (rgerhards), 2008-04-15 -- cgit From 5d76f2d5ca87fc42379d49022b505d66394c001b Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 7 May 2008 12:11:26 +0200 Subject: support for liblogging 0.7.1+ added --- rfc3195d.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rfc3195d.c b/rfc3195d.c index e7d13e03..c8179b27 100644 --- a/rfc3195d.c +++ b/rfc3195d.c @@ -42,9 +42,9 @@ int main() #include #include #include "rsyslog.h" -#include "liblogging.h" -#include "srAPI.h" -#include "syslogmessage.h" +#include "liblogging/liblogging.h" +#include "liblogging/srAPI.h" +#include "liblogging/syslogmessage.h" /* configurable params! */ static char* pPathLogname = "/dev/log3195"; -- cgit From 0fe0489d83447d98113f3f7b43587c9c92a27148 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 7 May 2008 12:14:23 +0200 Subject: updated ChangeLog (forgotten...) --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 8feac649..5edc96fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Version 2.0.5 STABLE (rgerhards), 2008-??-?? - bugfix: regular expressions inside property replacer did not work properly +- adapted to liblogging 0.7.1+ --------------------------------------------------------------------------- Version 2.0.4 STABLE (rgerhards), 2008-03-27 - bugfix: internally generated messages had "FROMHOST" property not set -- cgit From d2b63414ef92cde8a3107b8d17b74b1518775df6 Mon Sep 17 00:00:00 2001 From: varmojfekoj Date: Wed, 14 May 2008 08:32:40 +0200 Subject: fixed potential segfault due to invalid call to cfsysline thanks to varmojfekoj for the patch Signed-off-by: Rainer Gerhards --- ChangeLog | 4 ++++ plugins/imtcp/imtcp.c | 4 ++-- plugins/omgssapi/omgssapi.c | 2 +- plugins/omsnmp/omsnmp.c | 8 ++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e00c5657..637f7b61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ --------------------------------------------------------------------------- +Version 3.19.2 (rgerhards), 2008-05-14 +- fixed potential segfault due to invalid call to cfsysline + thanks to varmojfekoj for the patch +--------------------------------------------------------------------------- Version 3.19.1 (rgerhards), 2008-05-07 - configure help for --enable-gnutls wrong - said default is "yes" but default actually is "no" - thanks to darix for pointing this out diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index 1bf30493..971d3aec 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -225,8 +225,8 @@ CODEmodInit_QueryRegCFSLineHdlr addTCPListener, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpmaxsessions", 0, eCmdHdlrInt, NULL, &iTCPSessMax, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr((uchar *)"inputtcpserverstreamdrivermode", 0, - eCmdHdlrInt, NULL, &iStrmDrvrMode, NULL)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpserverstreamdrivermode", 0, + eCmdHdlrInt, NULL, &iStrmDrvrMode, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff --git a/plugins/omgssapi/omgssapi.c b/plugins/omgssapi/omgssapi.c index 6d419de0..e15c24e1 100644 --- a/plugins/omgssapi/omgssapi.c +++ b/plugins/omgssapi/omgssapi.c @@ -681,7 +681,7 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssforwardservicename", 0, eCmdHdlrGetWord, NULL, &gss_base_service_name, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssmode", 0, eCmdHdlrGetWord, setGSSMode, &gss_mode, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr((uchar *)"actiongssforwarddefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, NULL)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actiongssforwarddefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c index 21165f9b..8af5f22a 100644 --- a/plugins/omsnmp/omsnmp.c +++ b/plugins/omsnmp/omsnmp.c @@ -518,14 +518,14 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptransport", 0, eCmdHdlrGetWord, NULL, &pszTransport, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptarget", 0, eCmdHdlrGetWord, NULL, &pszTarget, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmptargetport", 0, eCmdHdlrInt, NULL, &iPort, NULL)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmpversion", 0, eCmdHdlrInt, NULL, &iSNMPVersion, NULL)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptargetport", 0, eCmdHdlrInt, NULL, &iPort, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpversion", 0, eCmdHdlrInt, NULL, &iSNMPVersion, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpcommunity", 0, eCmdHdlrGetWord, NULL, &pszCommunity, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpenterpriseoid", 0, eCmdHdlrGetWord, NULL, &pszEnterpriseOID, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptrapoid", 0, eCmdHdlrGetWord, NULL, &pszSnmpTrapOID, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpsyslogmessageoid", 0, eCmdHdlrGetWord, NULL, &pszSyslogMessageOID, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmpspecifictype", 0, eCmdHdlrInt, NULL, &iSpecificType, NULL)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmptraptype", 0, eCmdHdlrInt, NULL, &iTrapType, NULL)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpspecifictype", 0, eCmdHdlrInt, NULL, &iSpecificType, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptraptype", 0, eCmdHdlrInt, NULL, &iTrapType, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit /* -- cgit From aa983c583b694d878c034bee9d157333f8e2e883 Mon Sep 17 00:00:00 2001 From: varmojfekoj Date: Wed, 14 May 2008 08:39:36 +0200 Subject: fixed potential segfault due to invalid call to cfsysline thanks to varmojfekoj for the patch Signed-off-by: Rainer Gerhards --- ChangeLog | 4 ++++ plugins/omgssapi/omgssapi.c | 2 +- plugins/omsnmp/omsnmp.c | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b64b0f6..1f991d93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ --------------------------------------------------------------------------- +Version 3.16.2 (rgerhards), 2008-05-14 +- fixed potential segfault due to invalid call to cfsysline + thanks to varmojfekoj for the patch +--------------------------------------------------------------------------- Version 3.16.1 (rgerhards), 2008-05-02 - fixed a bug in imklog which lead to startup problems (including segfault) on some platforms under some circumsances. Thanks to diff --git a/plugins/omgssapi/omgssapi.c b/plugins/omgssapi/omgssapi.c index 9a7e8ab9..be051776 100644 --- a/plugins/omgssapi/omgssapi.c +++ b/plugins/omgssapi/omgssapi.c @@ -696,7 +696,7 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssforwardservicename", 0, eCmdHdlrGetWord, NULL, &gss_base_service_name, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"gssmode", 0, eCmdHdlrGetWord, setGSSMode, &gss_mode, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr((uchar *)"actiongssforwarddefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, NULL)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"actiongssforwarddefaulttemplate", 0, eCmdHdlrGetWord, NULL, &pszTplName, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit diff --git a/plugins/omsnmp/omsnmp.c b/plugins/omsnmp/omsnmp.c index 161ec073..22d48340 100644 --- a/plugins/omsnmp/omsnmp.c +++ b/plugins/omsnmp/omsnmp.c @@ -518,14 +518,14 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptransport", 0, eCmdHdlrGetWord, NULL, &pszTransport, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptarget", 0, eCmdHdlrGetWord, NULL, &pszTarget, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmptargetport", 0, eCmdHdlrInt, NULL, &iPort, NULL)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmpversion", 0, eCmdHdlrInt, NULL, &iSNMPVersion, NULL)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptargetport", 0, eCmdHdlrInt, NULL, &iPort, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpversion", 0, eCmdHdlrInt, NULL, &iSNMPVersion, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpcommunity", 0, eCmdHdlrGetWord, NULL, &pszCommunity, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpenterpriseoid", 0, eCmdHdlrGetWord, NULL, &pszEnterpriseOID, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptrapoid", 0, eCmdHdlrGetWord, NULL, &pszSnmpTrapOID, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpsyslogmessageoid", 0, eCmdHdlrGetWord, NULL, &pszSyslogMessageOID, STD_LOADABLE_MODULE_ID)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmpspecifictype", 0, eCmdHdlrInt, NULL, &iSpecificType, NULL)); - CHKiRet(regCfSysLineHdlr( (uchar *)"actionsnmptraptype", 0, eCmdHdlrInt, NULL, &iTrapType, NULL)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmpspecifictype", 0, eCmdHdlrInt, NULL, &iSpecificType, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr( (uchar *)"actionsnmptraptype", 0, eCmdHdlrInt, NULL, &iTrapType, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr( (uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit /* -- cgit From 8aea6a1d9d5a623018747844b65cf6c0dfd57192 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 14 May 2008 18:37:23 +0200 Subject: bugfix: some whitespaces where incorrectly not ignored when parsing the config file. This is now corrected. Thanks to Michael Biebl for pointing out the problem. --- ChangeLog | 3 +++ cfsysline.c | 2 ++ conf.c | 1 + 3 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1f991d93..213230a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ Version 3.16.2 (rgerhards), 2008-05-14 - fixed potential segfault due to invalid call to cfsysline thanks to varmojfekoj for the patch +- bugfix: some whitespaces where incorrectly not ignored when parsing + the config file. This is now corrected. Thanks to Michael Biebl for + pointing out the problem. --------------------------------------------------------------------------- Version 3.16.1 (rgerhards), 2008-05-02 - fixed a bug in imklog which lead to startup problems (including diff --git a/cfsysline.c b/cfsysline.c index 1aebc354..d3203ccc 100644 --- a/cfsysline.c +++ b/cfsysline.c @@ -462,6 +462,8 @@ getWord(uchar **pp, cstr_t **ppStrB) CHKiRet(rsCStrConstruct(ppStrB)); + skipWhiteSpace(pp); /* skip over any whitespace */ + /* parse out the word */ p = *pp; diff --git a/conf.c b/conf.c index f87ab992..5f0dca0f 100644 --- a/conf.c +++ b/conf.c @@ -230,6 +230,7 @@ doModLoad(uchar **pp, __attribute__((unused)) void* pVal) ASSERT(pp != NULL); ASSERT(*pp != NULL); + skipWhiteSpace(pp); /* skip over any whitespace */ if(getSubString(pp, (char*) szName, sizeof(szName) / sizeof(uchar), ' ') != 0) { errmsg.LogError(NO_ERRCODE, "could not extract module name"); ABORT_FINALIZE(RS_RET_NOT_FOUND); -- cgit From ce0569ec3ecb2116fb41006ca57498eccf1de43c Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 14 May 2008 18:52:53 +0200 Subject: ugfix: lmtcpclt, lmtcpsrv and lmgssutil did all link to the static runtime library, resulting in a large size increase (and potential "interesting" effects). Thanks to Michael Biebel for reporting the size issue. --- ChangeLog | 6 ++++++ Makefile.am | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 637f7b61..905c2594 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ --------------------------------------------------------------------------- +Version 3.19.3 (rgerhards), 2008-05-?? +- bugfix: lmtcpclt, lmtcpsrv and lmgssutil did all link to the static + runtime library, resulting in a large size increase (and potential + "interesting" effects). Thanks to Michael Biebel for reporting the size + issue. +--------------------------------------------------------------------------- Version 3.19.2 (rgerhards), 2008-05-14 - fixed potential segfault due to invalid call to cfsysline thanks to varmojfekoj for the patch diff --git a/Makefile.am b/Makefile.am index b16e5beb..61edc634 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,7 @@ lmtcpsrv_la_SOURCES = \ tcpsrv.c \ tcpsrv.h lmtcpsrv_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags) -lmtcpsrv_la_LDFLAGS = -module -avoid-version $(rsrt_libs) +lmtcpsrv_la_LDFLAGS = -module -avoid-version lmtcpsrv_la_LIBADD = # @@ -24,7 +24,7 @@ lmtcpclt_la_SOURCES = \ tcpclt.c \ tcpclt.h lmtcpclt_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags) -lmtcpclt_la_LDFLAGS = -module -avoid-version $(rsrt_libs) +lmtcpclt_la_LDFLAGS = -module -avoid-version lmtcpclt_la_LIBADD = endif # if ENABLE_INET @@ -36,7 +36,7 @@ if ENABLE_GSSAPI pkglib_LTLIBRARIES += lmgssutil.la lmgssutil_la_SOURCES = gss-misc.c gss-misc.h lmgssutil_la_CPPFLAGS = $(pthreads_cflags) $(rsrt_cflags) -lmgssutil_la_LDFLAGS = -module -avoid-version $(rsrt_libs) +lmgssutil_la_LDFLAGS = -module -avoid-version lmgssutil_la_LIBADD = $(gss_libs) endif -- cgit From d8b191a1f37ca3f5331afa25480d49612335b674 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 15 May 2008 07:58:01 +0200 Subject: bugfix: TLS server went into an endless loop in some situations. Thanks to Michael Biebl for reporting the problem. --- ChangeLog | 2 ++ runtime/nsd_gtls.c | 6 ++++++ runtime/nsdsel_gtls.c | 4 ++++ tcps_sess.c | 14 +------------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 905c2594..f84f3146 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Version 3.19.3 (rgerhards), 2008-05-?? runtime library, resulting in a large size increase (and potential "interesting" effects). Thanks to Michael Biebel for reporting the size issue. +- bugfix: TLS server went into an endless loop in some situations. + Thanks to Michael Biebl for reporting the problem. --------------------------------------------------------------------------- Version 3.19.2 (rgerhards), 2008-05-14 - fixed potential segfault due to invalid call to cfsysline diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index 03ceba7b..be3910f9 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -534,6 +534,12 @@ Rcv(nsd_t *pNsd, uchar *pBuf, ssize_t *pLenBuf) /* in TLS mode now */ lenRcvd = gnutls_record_recv(pThis->sess, pBuf, *pLenBuf); + if(lenRcvd < 0) { +int gnuRet; /* this is a hack */ + *pLenBuf = -1; + CHKgnutls(lenRcvd); /* this will abort the function */ + } + *pLenBuf = lenRcvd; finalize_it: diff --git a/runtime/nsdsel_gtls.c b/runtime/nsdsel_gtls.c index 1ee4b46c..24c074f6 100644 --- a/runtime/nsdsel_gtls.c +++ b/runtime/nsdsel_gtls.c @@ -141,6 +141,10 @@ doRetry(nsd_gtls_t *pNsd) if(gnuRet == 0) { pNsd->rtryCall = gtlsRtry_None; /* we are done */ } else if(gnuRet != GNUTLS_E_AGAIN && gnuRet != GNUTLS_E_INTERRUPTED) { + uchar *pErr = gtlsStrerror(gnuRet); + dbgprintf("unexpected GnuTLS error %d in %s:%d: %s\n", gnuRet, __FILE__, __LINE__, pErr); + free(pErr); + pNsd->rtryCall = gtlsRtry_None; /* we are also done... ;) */ ABORT_FINALIZE(RS_RET_GNUTLS_ERR); } /* if we are interrupted once again (else case), we do not need to diff --git a/tcps_sess.c b/tcps_sess.c index 0460ebe5..1a57c8cb 100644 --- a/tcps_sess.c +++ b/tcps_sess.c @@ -341,19 +341,7 @@ DataRcvd(tcps_sess_t *pThis, char *pData, size_t iLen) assert(pData != NULL); assert(iLen > 0); - /* We now copy the message to the session buffer. As - * it looks, we need to do this in any case because - * we might run into multiple messages inside a single - * buffer. Of course, we could think about optimizations, - * but as this code is to be replaced by liblogging, it - * probably doesn't make so much sense... - * rgerhards 2005-07-04 - * - * Algo: - * - copy message to buffer until the first LF is found - * - printline() the buffer - * - continue with copying - */ + /* We now copy the message to the session buffer. */ pEnd = pData + iLen; /* this is one off, which is intensional */ while(pData < pEnd) { -- cgit From e623b1a06bab31665c9185659dad7c7783229ac9 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 15 May 2008 11:57:18 +0200 Subject: added TODO item --- runtime/nsd_gtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index be3910f9..5ae92913 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -535,7 +535,7 @@ Rcv(nsd_t *pNsd, uchar *pBuf, ssize_t *pLenBuf) /* in TLS mode now */ lenRcvd = gnutls_record_recv(pThis->sess, pBuf, *pLenBuf); if(lenRcvd < 0) { -int gnuRet; /* this is a hack */ + int gnuRet; /* TODO: build a specific function for GnuTLS error reporting */ *pLenBuf = -1; CHKgnutls(lenRcvd); /* this will abort the function */ } -- cgit From 3daa227bdd125cc8a6db1980f3d786f9ce2b0e2c Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 15 May 2008 12:38:35 +0200 Subject: finalizing 2.0.5 release --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5edc96fe..9873509e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ --------------------------------------------------------------------------- -Version 2.0.5 STABLE (rgerhards), 2008-??-?? +Version 2.0.5 STABLE (rgerhards), 2008-05-15 - bugfix: regular expressions inside property replacer did not work properly - adapted to liblogging 0.7.1+ -- cgit From 5674b8ef46ad0ec7c3c795f7981b6fd2d0b8330e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 15 May 2008 12:40:48 +0200 Subject: bumped version number --- ChangeLog | 2 ++ configure.ac | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9873509e..832d078e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ --------------------------------------------------------------------------- +Version 2.0.6 V2-STABLE (rgerhards), 2008-??-?? +--------------------------------------------------------------------------- Version 2.0.5 STABLE (rgerhards), 2008-05-15 - bugfix: regular expressions inside property replacer did not work properly diff --git a/configure.ac b/configure.ac index 6163078f..14fb086c 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],[2.0.5],[rsyslog@lists.adiscon.com.]) +AC_INIT([rsyslog],[2.0.6],[rsyslog@lists.adiscon.com.]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([syslogd.c]) AC_CONFIG_HEADERS([config.h]) -- cgit From a58ad72051a73b8a26e792507544ad4b41283ca7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 15 May 2008 15:42:52 +0200 Subject: bumped version number --- ChangeLog | 4 +--- configure.ac | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f84f3146..cfbc81a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,11 @@ --------------------------------------------------------------------------- -Version 3.19.3 (rgerhards), 2008-05-?? +Version 3.19.2 (rgerhards), 2008-05-?? - bugfix: lmtcpclt, lmtcpsrv and lmgssutil did all link to the static runtime library, resulting in a large size increase (and potential "interesting" effects). Thanks to Michael Biebel for reporting the size issue. - bugfix: TLS server went into an endless loop in some situations. Thanks to Michael Biebl for reporting the problem. ---------------------------------------------------------------------------- -Version 3.19.2 (rgerhards), 2008-05-14 - fixed potential segfault due to invalid call to cfsysline thanks to varmojfekoj for the patch --------------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 391063f9..a352da31 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],[3.19.1],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.19.2],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([ChangeLog]) AC_CONFIG_HEADERS([config.h]) -- cgit From 09afe64f29bae5af8ea1749373e8c8b6586b70d1 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 16 May 2008 13:36:41 +0200 Subject: added fromhost-ip properties and some bugfixes - bugfix: TCP input modules did incorrectly set fromhost property (always blank) - bugfix: imklog did not set fromhost property - added "fromhost-ip" property - added "RSYSLOG_DebugFormat" canned template - bugfix: hostname and fromhost were swapped when a persisted message (in queued mode) was read in --- ChangeLog | 12 ++++++++++++ dirty.h | 2 +- doc/property_replacer.html | 10 ++++++++-- doc/rsyslog_conf.html | 4 ++++ plugins/im3195/im3195.c | 3 ++- plugins/imklog/imklog.c | 2 ++ plugins/imrelp/imrelp.c | 4 +++- plugins/imudp/imudp.c | 5 +++-- plugins/imuxsock/imuxsock.c | 3 ++- runtime/msg.c | 41 +++++++++++++++++++++++++++++++++++++++-- runtime/msg.h | 3 +++ runtime/net.c | 15 +++++++++------ runtime/net.h | 4 ++-- runtime/nsd_gtls.c | 2 +- runtime/nsd_gtls.h | 2 ++ tcps_sess.c | 37 +++++++++++++++++++++++++++++++------ tcps_sess.h | 2 ++ tcpsrv.c | 5 ++++- tools/syslogd.c | 25 +++++++++++++++++++------ 19 files changed, 149 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfbc81a7..991efb88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ --------------------------------------------------------------------------- Version 3.19.2 (rgerhards), 2008-05-?? +- bugfix: TCP input modules did incorrectly set fromhost property + (always blank) +- bugfix: imklog did not set fromhost property +- added "fromhost-ip" property + Note that adding this property changes the on-disk format for messages. + However, that should not have any bad effect on existing spool files. + But you will run into trouble if you create a spool file with this + version and then try to process it with an older one (after a downgrade). + Don't do that ;) +- added "RSYSLOG_DebugFormat" canned template +- bugfix: hostname and fromhost were swapped when a persisted message + (in queued mode) was read in - bugfix: lmtcpclt, lmtcpsrv and lmgssutil did all link to the static runtime library, resulting in a large size increase (and potential "interesting" effects). Thanks to Michael Biebel for reporting the size diff --git a/dirty.h b/dirty.h index 6c451662..2782eea8 100644 --- a/dirty.h +++ b/dirty.h @@ -42,7 +42,7 @@ rsRetVal submitMsg(msg_t *pMsg); rsRetVal logmsgInternal(int pri, uchar *msg, int flags); -rsRetVal parseAndSubmitMessage(uchar *hname, uchar *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType); +rsRetVal parseAndSubmitMessage(uchar *hname, uchar *hnameIP, uchar *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType); /* TODO: the following 2 need to go in conf obj interface... */ rsRetVal cflineParseTemplateName(uchar** pp, omodStringRequest_t *pOMSR, int iEntry, int iTplOpts, uchar *dfltTplName); diff --git a/doc/property_replacer.html b/doc/property_replacer.html index a2efaede..4fa7ee4a 100644 --- a/doc/property_replacer.html +++ b/doc/property_replacer.html @@ -44,7 +44,13 @@ socket. Should be useful for debugging. fromhost hostname of the system the message was received from (in a relay chain, this is the system immediately in front of us and -not necessarily the original sender) +not necessarily the original sender). This is a DNS-resolved name, except +if that is not possible or DNS resolution has been disabled. + + +fromhost-ip +The same as fromhost, but alsways as an IP address. Local inputs +(like imklog) use 127.0.0.1 in this property. syslogtag @@ -286,4 +292,4 @@ to record severity and facility of a message)
  • Configuration file syntax, this is where you actually use the property replacer.
  • - \ No newline at end of file + diff --git a/doc/rsyslog_conf.html b/doc/rsyslog_conf.html index 545bdbc2..a78a70c1 100644 --- a/doc/rsyslog_conf.html +++ b/doc/rsyslog_conf.html @@ -353,6 +353,10 @@ all relatively recent versions of rsyslog. Other syslogd's may get hopelessly confused if receiving that format, so check before you use it. Note that the format is unlikely to change when the final RFC comes out, but this may happen. +
  • RSYSLOG_DebugFormat +- a special format used for troubleshooting property problems. This format +is meant to be written to a log file. Do not use for production or remote +forwarding.
  • Output Channels

    Output Channels are a new concept first introduced in rsyslog diff --git a/plugins/im3195/im3195.c b/plugins/im3195/im3195.c index 76d54e40..d9c220b2 100644 --- a/plugins/im3195/im3195.c +++ b/plugins/im3195/im3195.c @@ -78,10 +78,11 @@ void OnReceive(srAPIObj __attribute__((unused)) *pMyAPI, srSLMGObj* pSLMG) { uchar *pszRawMsg; uchar *fromHost = (uchar*) "[unset]"; /* TODO: get hostname */ + uchar *fromHostIP = (uchar*) "[unset]"; /* TODO: get hostname */ srSLMGGetRawMSG(pSLMG, &pszRawMsg); - parseAndSubmitMessage((char*)fromHost, (char*) pszRawMsg, strlen((char*)pszRawMsg), + parseAndSubmitMessage(fromHost, fromHostIP, pszRawMsg, strlen((char*)pszRawMsg), MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_FULL_DELAY); } diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c index e5888620..5bd99d9e 100644 --- a/plugins/imklog/imklog.c +++ b/plugins/imklog/imklog.c @@ -97,6 +97,8 @@ enqMsg(uchar *msg, uchar* pszTag, int iFacility, int iSeverity) MsgSetUxTradMsg(pMsg, (char*)msg); MsgSetRawMsg(pMsg, (char*)msg); MsgSetMSG(pMsg, (char*)msg); + MsgSetRcvFrom(pMsg, (char*)glbl.GetLocalHostName()); + MsgSetRcvFromIP(pMsg, (uchar*)"127.0.0.1"); MsgSetHOSTNAME(pMsg, (char*)glbl.GetLocalHostName()); MsgSetTAG(pMsg, (char*)pszTag); pMsg->iFacility = LOG_FAC(iFacility); diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index 3fe030bc..5c9bbce1 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -76,12 +76,14 @@ isPermittedHost(struct sockaddr *addr, char *fromHostFQDN, void __attribute__((u * are different from our rsRetVal. So we can simply use our own iRet system * to fulfill the requirement. * rgerhards, 2008-03-21 + * TODO: we currently do not receive the remote hosts's IP. As a work-around, we + * use "???" for the time being. -- rgerhards, 2008-05-16 */ static relpRetVal onSyslogRcv(uchar *pHostname, uchar __attribute__((unused)) *pIP, uchar *pMsg, size_t lenMsg) { DEFiRet; - parseAndSubmitMessage(pHostname, pMsg, lenMsg, MSG_PARSE_HOSTNAME, + parseAndSubmitMessage(pHostname, (uchar*) "[unset]", pMsg, lenMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); RETiRet; diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 5fdb3c91..54dc6836 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -135,6 +135,7 @@ BEGINrunInput struct sockaddr_storage frominet; socklen_t socklen; uchar fromHost[NI_MAXHOST]; + uchar fromHostIP[NI_MAXHOST]; uchar fromHostFQDN[NI_MAXHOST]; ssize_t l; CODESTARTrunInput @@ -182,7 +183,7 @@ CODESTARTrunInput l = recvfrom(udpLstnSocks[i+1], (char*) pRcvBuf, MAXLINE - 1, 0, (struct sockaddr *)&frominet, &socklen); if (l > 0) { - if(net.cvthname(&frominet, fromHost, fromHostFQDN) == RS_RET_OK) { + if(net.cvthname(&frominet, fromHost, fromHostFQDN, fromHostIP) == RS_RET_OK) { dbgprintf("Message from inetd socket: #%d, host: %s\n", udpLstnSocks[i+1], fromHost); /* Here we check if a host is permitted to send us @@ -193,7 +194,7 @@ CODESTARTrunInput */ if(net.isAllowedSender(net.pAllowedSenders_UDP, (struct sockaddr *)&frominet, (char*)fromHostFQDN)) { - parseAndSubmitMessage(fromHost, pRcvBuf, l, + parseAndSubmitMessage(fromHost, fromHostIP, pRcvBuf, l, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_NO_DELAY); } else { dbgprintf("%s is not an allowed sender\n", (char*)fromHostFQDN); diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 4b7cc563..82fd118e 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -181,7 +181,8 @@ static rsRetVal readSocket(int fd, int bParseHost, int flags) iRcvd = recv(fd, line, MAXLINE - 1, 0); dbgprintf("Message from UNIX socket: #%d\n", fd); if (iRcvd > 0) { - parseAndSubmitMessage(glbl.GetLocalHostName(), line, iRcvd, bParseHost, flags, eFLOWCTL_LIGHT_DELAY); + parseAndSubmitMessage(glbl.GetLocalHostName(), (uchar*)"127.0.0.1", line, + iRcvd, bParseHost, flags, eFLOWCTL_LIGHT_DELAY); } else if (iRcvd < 0 && errno != EINTR) { char errStr[1024]; rs_strerror_r(errno, errStr, sizeof(errStr)); diff --git a/runtime/msg.c b/runtime/msg.c index e72ef71b..b421c88f 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -263,6 +263,8 @@ CODESTARTobjDestruct(msg) free(pThis->pszHOSTNAME); if(pThis->pszRcvFrom != NULL) free(pThis->pszRcvFrom); + if(pThis->pszRcvFromIP != NULL) + free(pThis->pszRcvFromIP); if(pThis->pszMSG != NULL) free(pThis->pszMSG); if(pThis->pszFacility != NULL) @@ -422,6 +424,7 @@ static rsRetVal MsgSerialize(msg_t *pThis, strm_t *pStrm) objSerializePTR(pStrm, pszTAG, PSZ); objSerializePTR(pStrm, pszHOSTNAME, PSZ); objSerializePTR(pStrm, pszRcvFrom, PSZ); + objSerializePTR(pStrm, pszRcvFromIP, PSZ); objSerializePTR(pStrm, pCSStrucData, CSTR); objSerializePTR(pStrm, pCSAPPNAME, CSTR); @@ -1171,6 +1174,18 @@ char *getRcvFrom(msg_t *pM) return (char*) pM->pszRcvFrom; } + +uchar *getRcvFromIP(msg_t *pM) +{ + if(pM == NULL) + return (uchar*) ""; + else + if(pM->pszRcvFromIP == NULL) + return (uchar*) ""; + else + return pM->pszRcvFromIP; +} + /* rgerhards 2004-11-24: set STRUCTURED DATA in msg object */ rsRetVal MsgSetStructuredData(msg_t *pMsg, char* pszStrucData) @@ -1344,6 +1359,24 @@ void MsgSetRcvFrom(msg_t *pMsg, char* pszRcvFrom) } +/* rgerhards 2005-05-16: set pszRcvFromIP in msg object */ +rsRetVal +MsgSetRcvFromIP(msg_t *pMsg, uchar* pszRcvFromIP) +{ + DEFiRet; + assert(pMsg != NULL); + if(pMsg->pszRcvFromIP != NULL) { + free(pMsg->pszRcvFromIP); + pMsg->iLenRcvFromIP = 0; + } + + CHKmalloc(pMsg->pszRcvFromIP = (uchar*)strdup((char*)pszRcvFromIP)); + pMsg->iLenRcvFromIP = strlen((char*)pszRcvFromIP); +finalize_it: + RETiRet; +} + + /* Set the HOSTNAME to a caller-provided string. This is thought * to be a heap buffer that the caller will no longer use. This * function is a performance optimization over MsgSetHOSTNAME(). @@ -1597,6 +1630,8 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe, pRes = getUxTradMsg(pMsg); } else if(!strcmp((char*) pName, "fromhost")) { pRes = getRcvFrom(pMsg); + } else if(!strcmp((char*) pName, "fromhost-ip")) { + pRes = (char*) getRcvFromIP(pMsg); } else if(!strcmp((char*) pName, "source") || !strcmp((char*) pName, "hostname")) { pRes = getHOSTNAME(pMsg); } else if(!strcmp((char*) pName, "syslogtag")) { @@ -2204,10 +2239,12 @@ rsRetVal MsgSetProperty(msg_t *pThis, var_t *pProp) MsgSetUxTradMsg(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); } else if(isProp("pszTAG")) { MsgSetTAG(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); + } else if(isProp("pszRcvFromIP")) { + MsgSetRcvFromIP(pThis, rsCStrGetSzStrNoNULL(pProp->val.pStr)); } else if(isProp("pszRcvFrom")) { - MsgSetHOSTNAME(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); - } else if(isProp("pszHOSTNAME")) { MsgSetRcvFrom(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); + } else if(isProp("pszHOSTNAME")) { + MsgSetHOSTNAME(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); } else if(isProp("pCSStrucData")) { MsgSetStructuredData(pThis, (char*) rsCStrGetSzStrNoNULL(pProp->val.pStr)); } else if(isProp("pCSAPPNAME")) { diff --git a/runtime/msg.h b/runtime/msg.h index 9ec038dd..084123b7 100644 --- a/runtime/msg.h +++ b/runtime/msg.h @@ -89,6 +89,8 @@ struct msg { int iLenHOSTNAME; /* Length of HOSTNAME */ uchar *pszRcvFrom; /* System message was received from */ int iLenRcvFrom; /* Length of pszRcvFrom */ + uchar *pszRcvFromIP; /* IP of system message was received from */ + int iLenRcvFromIP; /* Length of pszRcvFromIP */ short iProtocolVersion;/* protocol version of message received 0 - legacy, 1 syslog-protocol) */ cstr_t *pCSProgName; /* the (BSD) program name */ cstr_t *pCSStrucData;/* STRUCTURED-DATA */ @@ -149,6 +151,7 @@ char *getStructuredData(msg_t *pM); int getProgramNameLen(msg_t *pM); char *getProgramName(msg_t *pM); void MsgSetRcvFrom(msg_t *pMsg, char* pszRcvFrom); +rsRetVal MsgSetRcvFromIP(msg_t *pMsg, uchar* pszRcvFromIP); void MsgAssignHOSTNAME(msg_t *pMsg, char *pBuf); void MsgSetHOSTNAME(msg_t *pMsg, char* pszHOSTNAME); int MsgSetUxTradMsg(msg_t *pMsg, char* pszUxTradMsg); diff --git a/runtime/net.c b/runtime/net.c index 1d085290..7663b1b3 100644 --- a/runtime/net.c +++ b/runtime/net.c @@ -626,6 +626,8 @@ should_use_so_bsdcompat(void) * but has been moved out of it because of clarity and fuctional separation. * It must be provided by the socket we received the message on as well as * a NI_MAXHOST size large character buffer for the FQDN. + * 2008-05-16 rgerhards: added field for IP address representation. Must also + * be NI_MAXHOST size large. * * Please see http://www.hmug.org/man/3/getnameinfo.php (under Caveats) * for some explanation of the code found below. We do by default not @@ -635,23 +637,23 @@ should_use_so_bsdcompat(void) * message should be processed (1) or discarded (0). */ static rsRetVal -gethname(struct sockaddr_storage *f, uchar *pszHostFQDN) +gethname(struct sockaddr_storage *f, uchar *pszHostFQDN, uchar *ip) { DEFiRet; int error; sigset_t omask, nmask; - char ip[NI_MAXHOST]; struct addrinfo hints, *res; assert(f != NULL); assert(pszHostFQDN != NULL); error = getnameinfo((struct sockaddr *)f, SALEN((struct sockaddr *)f), - ip, sizeof ip, NULL, 0, NI_NUMERICHOST); + (char*) ip, sizeof ip, NULL, 0, NI_NUMERICHOST); if (error) { dbgprintf("Malformed from address %s\n", gai_strerror(error)); strcpy((char*) pszHostFQDN, "???"); + strcpy((char*) ip, "???"); ABORT_FINALIZE(RS_RET_INVALID_SOURCE); } @@ -713,7 +715,7 @@ gethname(struct sockaddr_storage *f, uchar *pszHostFQDN) if(error || glbl.GetDisableDNS()) { dbgprintf("Host name for your address (%s) unknown\n", ip); - strcpy((char*) pszHostFQDN, ip); + strcpy((char*) pszHostFQDN, (char*)ip); ABORT_FINALIZE(RS_RET_ADDRESS_UNKNOWN); } @@ -773,8 +775,9 @@ void debugListenInfo(int fd, char *type) * there is no way to check it. We use this way of doing things because it * frees us from using dynamic memory allocation where it really does not * pay. + * 2005-05-16 rgerhards: added IP representation. Must also be NI_MAXHOST */ -rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN) +rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN, uchar *pszIP) { DEFiRet; register uchar *p; @@ -784,7 +787,7 @@ rsRetVal cvthname(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN assert(pszHost != NULL); assert(pszHostFQDN != NULL); - iRet = gethname(f, pszHostFQDN); + iRet = gethname(f, pszHostFQDN, pszIP); if(iRet == RS_RET_INVALID_SOURCE || iRet == RS_RET_ADDRESS_UNKNOWN) { strcpy((char*) pszHost, (char*) pszHostFQDN); /* we use whatever was provided as replacement */ diff --git a/runtime/net.h b/runtime/net.h index 59199451..9e471bf9 100644 --- a/runtime/net.h +++ b/runtime/net.h @@ -93,7 +93,7 @@ struct AllowedSenders { /* interfaces */ BEGINinterface(net) /* name must also be changed in ENDinterface macro! */ - rsRetVal (*cvthname)(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN); + rsRetVal (*cvthname)(struct sockaddr_storage *f, uchar *pszHost, uchar *pszHostFQDN, uchar *pszIP); /* things to go away after proper modularization */ rsRetVal (*addAllowedSenderLine)(char* pName, uchar** ppRestOfConfLine); void (*PrintAllowedSenders)(int iListToPrint); @@ -111,7 +111,7 @@ BEGINinterface(net) /* name must also be changed in ENDinterface macro! */ struct AllowedSenders *pAllowedSenders_TCP; struct AllowedSenders *pAllowedSenders_GSS; ENDinterface(net) -#define netCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ +#define netCURR_IF_VERSION 3 /* increment whenever you change the interface structure! */ /* prototypes */ PROTOTYPEObj(net); diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index 5ae92913..5ea7ceb9 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -471,7 +471,7 @@ AcceptConnReq(nsd_t *pNsd, nsd_t **ppNew) nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd; ISOBJ_TYPE_assert((pThis), nsd_gtls); - CHKiRet(nsd_gtlsConstruct(&pNew)); + CHKiRet(nsd_gtlsConstruct(&pNew)); // TODO: prevent construct/destruct! CHKiRet(nsd_ptcp.Destruct(&pNew->pTcp)); CHKiRet(nsd_ptcp.AcceptConnReq(pThis->pTcp, &pNew->pTcp)); diff --git a/runtime/nsd_gtls.h b/runtime/nsd_gtls.h index 83e15f29..bbb0eb9e 100644 --- a/runtime/nsd_gtls.h +++ b/runtime/nsd_gtls.h @@ -50,6 +50,8 @@ struct nsd_gtls_s { /* prototypes */ PROTOTYPEObj(nsd_gtls); +/* some prototypes for things used by our nsdsel_gtls helper class */ +uchar *gtlsStrerror(int error); /* the name of our library binary */ #define LM_NSD_GTLS_FILENAME "lmnsd_gtls" diff --git a/tcps_sess.c b/tcps_sess.c index 1a57c8cb..6243d91f 100644 --- a/tcps_sess.c +++ b/tcps_sess.c @@ -90,6 +90,8 @@ CODESTARTobjDestruct(tcps_sess) /* now destruct our own properties */ if(pThis->fromHost != NULL) free(pThis->fromHost); + if(pThis->fromHostIP != NULL) + free(pThis->fromHostIP); ENDobjDestruct(tcps_sess) @@ -102,7 +104,7 @@ ENDobjDebugPrint(tcps_sess) /* set property functions */ /* set the hostname. Note that the caller *hands over* the string. That is, * the caller no longer controls it once SetHost() has received it. Most importantly, - * the caller must not free it. -- gerhards, 2008-04-24 + * the caller must not free it. -- rgerhards, 2008-04-24 */ static rsRetVal SetHost(tcps_sess_t *pThis, uchar *pszHost) @@ -120,6 +122,26 @@ SetHost(tcps_sess_t *pThis, uchar *pszHost) RETiRet; } +/* set the remote host's IP. Note that the caller *hands over* the string. That is, + * the caller no longer controls it once SetHostIP() has received it. Most importantly, + * the caller must not free it. -- rgerhards, 2008-05-16 + */ +static rsRetVal +SetHostIP(tcps_sess_t *pThis, uchar *pszHostIP) +{ + DEFiRet; + + ISOBJ_TYPE_assert(pThis, tcps_sess); + + if(pThis->fromHostIP != NULL) { + free(pThis->fromHostIP); + } + + pThis->fromHostIP = pszHostIP; + + RETiRet; +} + static rsRetVal SetStrm(tcps_sess_t *pThis, netstrm_t *pStrm) { @@ -140,7 +162,7 @@ SetMsgIdx(tcps_sess_t *pThis, int idx) } -/* set out parent, the tcpsrv object */ +/* set our parent, the tcpsrv object */ static rsRetVal SetTcpsrv(tcps_sess_t *pThis, tcpsrv_t *pSrv) { @@ -200,7 +222,7 @@ PrepareClose(tcps_sess_t *pThis) * this case. */ dbgprintf("Extra data at end of stream in legacy syslog/tcp message - processing\n"); - parseAndSubmitMessage(pThis->fromHost, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); + parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); pThis->bAtStrtOfFram = 1; } @@ -222,6 +244,8 @@ Close(tcps_sess_t *pThis) netstrm.Destruct(&pThis->pStrm); free(pThis->fromHost); pThis->fromHost = NULL; /* not really needed, but... */ + free(pThis->fromHostIP); + pThis->fromHostIP = NULL; /* not really needed, but... */ RETiRet; } @@ -280,7 +304,7 @@ processDataRcvd(tcps_sess_t *pThis, char c) if(pThis->iMsg >= MAXLINE) { /* emergency, we now need to flush, no matter if we are at end of message or not... */ dbgprintf("error: message received is larger than MAXLINE, we split it\n"); - parseAndSubmitMessage(pThis->fromHost, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); + parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); pThis->iMsg = 0; /* we might think if it is better to ignore the rest of the * message than to treat it as a new one. Maybe this is a good @@ -290,7 +314,7 @@ processDataRcvd(tcps_sess_t *pThis, char c) } if(c == '\n' && pThis->eFraming == TCP_FRAMING_OCTET_STUFFING) { /* record delemiter? */ - parseAndSubmitMessage(pThis->fromHost, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); + parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); pThis->iMsg = 0; pThis->inputState = eAtStrtFram; } else { @@ -308,7 +332,7 @@ processDataRcvd(tcps_sess_t *pThis, char c) pThis->iOctetsRemain--; if(pThis->iOctetsRemain < 1) { /* we have end of frame! */ - parseAndSubmitMessage(pThis->fromHost, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); + parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->msg, pThis->iMsg, MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY); pThis->iMsg = 0; pThis->inputState = eAtStrtFram; } @@ -379,6 +403,7 @@ CODESTARTobjQueryInterface(tcps_sess) pIf->SetUsrP = SetUsrP; pIf->SetTcpsrv = SetTcpsrv; pIf->SetHost = SetHost; + pIf->SetHostIP = SetHostIP; pIf->SetStrm = SetStrm; pIf->SetMsgIdx = SetMsgIdx; finalize_it: diff --git a/tcps_sess.h b/tcps_sess.h index db52e102..ff7c167a 100644 --- a/tcps_sess.h +++ b/tcps_sess.h @@ -44,6 +44,7 @@ typedef struct tcps_sess_s { TCPFRAMINGMODE eFraming; uchar msg[MAXLINE+1]; uchar *fromHost; + uchar *fromHostIP; void *pUsr; /* a user-pointer */ } tcps_sess_t; @@ -61,6 +62,7 @@ BEGINinterface(tcps_sess) /* name must also be changed in ENDinterface macro! */ rsRetVal (*SetTcpsrv)(tcps_sess_t *pThis, struct tcpsrv_s *pSrv); rsRetVal (*SetUsrP)(tcps_sess_t*, void*); rsRetVal (*SetHost)(tcps_sess_t *pThis, uchar*); + rsRetVal (*SetHostIP)(tcps_sess_t *pThis, uchar*); rsRetVal (*SetStrm)(tcps_sess_t *pThis, netstrm_t*); rsRetVal (*SetMsgIdx)(tcps_sess_t *pThis, int); ENDinterface(tcps_sess) diff --git a/tcpsrv.c b/tcpsrv.c index 4501e834..6db2fee7 100644 --- a/tcpsrv.c +++ b/tcpsrv.c @@ -314,6 +314,7 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm) int iSess = -1; struct sockaddr_storage addr; uchar *fromHostFQDN = NULL; + uchar *fromHostIP = NULL; ISOBJ_TYPE_assert(pThis, tcpsrv); @@ -333,7 +334,8 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm) /* OK, we have a "good" index... */ /* get the host name */ - CHKiRet(netstrm.GetRemoteHName(pStrm, &fromHostFQDN)); + CHKiRet(netstrm.GetRemoteHName(pNewStrm, &fromHostFQDN)); + CHKiRet(netstrm.GetRemoteIP(pNewStrm, &fromHostIP)); /* TODO: check if we need to strip the domain name here -- rgerhards, 2008-04-24 */ /* Here we check if a host is permitted to send us messages. If it isn't, we do not further @@ -353,6 +355,7 @@ SessAccept(tcpsrv_t *pThis, tcps_sess_t **ppSess, netstrm_t *pStrm) * means we can finally fill in the session object. */ CHKiRet(tcps_sess.SetHost(pSess, fromHostFQDN)); + CHKiRet(tcps_sess.SetHostIP(pSess, fromHostIP)); CHKiRet(tcps_sess.SetStrm(pSess, pNewStrm)); pNewStrm = NULL; /* prevent it from being freed in error handler, now done in tcps_sess! */ CHKiRet(tcps_sess.SetMsgIdx(pSess, 0)); diff --git a/tools/syslogd.c b/tools/syslogd.c index 99179e3b..8b829771 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -392,6 +392,7 @@ static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __a /* hardcoded standard templates (used for defaults) */ +static uchar template_DebugFormat[] = "\"Debug line with all properties:\nFROMHOST: '%FROMHOST%', fromhost-ip: '%fromhost-ip%', HOSTNAME: '%HOSTNAME%', PRI: %PRI%,\nsyslogtag '%syslogtag%', programname: '%programname%', APP-NAME: '%APP-NAME%', PROCID: '%PROCID%', MSGID: '%MSGID%',\nTIMESTAMP: '%TIMESTAMP%', STRUCTURED-DATA: '%STRUCTURED-DATA%',\nmsg: '%msg%'\nescaped msg: '%msg:::drop-cc%'\nrawmsg: '%rawmsg%'\n\n\""; static uchar template_SyslogProtocol23Format[] = "\"<%PRI%>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n\""; static uchar template_TraditionalFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\""; static uchar template_FileFormat[] = "\"%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\""; @@ -597,16 +598,19 @@ void untty(void) * rgerhards, 2008-03-19: * I added an additional calling parameter to permit specifying the flow * control capability of the source. + * + * rgerhards, 2008-05-16: + * I added an additional calling parameter (hnameIP) to enable specifying the IP + * of a remote host. */ -rsRetVal printline(uchar *hname, uchar *msg, int bParseHost, int flags, flowControl_t flowCtlType) +rsRetVal printline(uchar *hname, uchar *hnameIP, uchar *msg, int bParseHost, int flags, flowControl_t flowCtlType) { DEFiRet; register uchar *p; int pri; msg_t *pMsg; - /* Now it is time to create the message object (rgerhards) - */ + /* Now it is time to create the message object (rgerhards) */ CHKiRet(msgConstruct(&pMsg)); MsgSetFlowControlType(pMsg, flowCtlType); MsgSetRawMsg(pMsg, (char*)msg); @@ -639,6 +643,7 @@ rsRetVal printline(uchar *hname, uchar *msg, int bParseHost, int flags, flowCont if(bParseHost == 0) MsgSetHOSTNAME(pMsg, (char*)hname); MsgSetRcvFrom(pMsg, (char*)hname); + CHKiRet(MsgSetRcvFromIP(pMsg, hnameIP)); /* rgerhards 2004-11-19: well, well... we've now seen that we * have the "hostname problem" also with the traditional Unix @@ -688,9 +693,13 @@ finalize_it: * rgerhards, 2008-03-19: * I added an additional calling parameter to permit specifying the flow * control capability of the source. + * + * rgerhards, 2008-05-16: + * I added an additional calling parameter (hnameIP) to enable specifying the IP + * of a remote host. */ rsRetVal -parseAndSubmitMessage(uchar *hname, uchar *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType) +parseAndSubmitMessage(uchar *hname, uchar *hnameIP, uchar *msg, int len, int bParseHost, int flags, flowControl_t flowCtlType) { DEFiRet; register int iMsg; @@ -704,6 +713,7 @@ parseAndSubmitMessage(uchar *hname, uchar *msg, int len, int bParseHost, int fla # endif assert(hname != NULL); + assert(hnameIP != NULL); assert(msg != NULL); assert(len >= 0); @@ -789,7 +799,7 @@ parseAndSubmitMessage(uchar *hname, uchar *msg, int len, int bParseHost, int fla */ if(iMsg == MAXLINE) { *(pMsg + iMsg) = '\0'; /* space *is* reserved for this! */ - printline(hname, tmpline, bParseHost, flags, flowCtlType); + printline(hname, hnameIP, tmpline, bParseHost, flags, flowCtlType); } else { /* This case in theory never can happen. If it happens, we have * a logic error. I am checking for it, because if I would not, @@ -841,7 +851,7 @@ parseAndSubmitMessage(uchar *hname, uchar *msg, int len, int bParseHost, int fla *(pMsg + iMsg) = '\0'; /* space *is* reserved for this! */ /* typically, we should end up here! */ - printline(hname, tmpline, bParseHost, flags, flowCtlType); + printline(hname, hnameIP, tmpline, bParseHost, flags, flowCtlType); finalize_it: RETiRet; @@ -880,6 +890,7 @@ logmsgInternal(int pri, uchar *msg, int flags) MsgSetRawMsg(pMsg, (char*)msg); MsgSetHOSTNAME(pMsg, (char*)glbl.GetLocalHostName()); MsgSetRcvFrom(pMsg, (char*)glbl.GetLocalHostName()); + MsgSetRcvFromIP(pMsg, (uchar*)"127.0.0.1"); MsgSetTAG(pMsg, "rsyslogd:"); pMsg->iFacility = LOG_FAC(pri); pMsg->iSeverity = LOG_PRI(pri); @@ -2715,6 +2726,8 @@ static void mainThread() */ /* initialize the build-in templates */ + pTmp = template_DebugFormat; + tplAddLine("RSYSLOG_DebugFormat", &pTmp); pTmp = template_SyslogProtocol23Format; tplAddLine("RSYSLOG_SyslogProtocol23Format", &pTmp); pTmp = template_FileFormat; /* new format for files with high-precision stamp */ -- cgit From c70d3cec69b0d00d0dbee26c451b61e81e9d91c8 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 16 May 2008 14:46:03 +0200 Subject: preparing for 3.19.2 --- doc/manual.html | 2 +- doc/professional_support.html | 55 +++++++++++++++++++++++++++++++++---------- doc/status.html | 12 +++++----- 3 files changed, 50 insertions(+), 19 deletions(-) diff --git a/doc/manual.html b/doc/manual.html index 84be70d3..242c272b 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -16,7 +16,7 @@ relay chains while at the same time being very easy to setup for the novice user. And as we know what enterprise users really need, there is also professional rsyslog support available directly from the source!

    -

    This documentation is for version 3.19.1 (devel branch) of rsyslog. +

    This documentation is for version 3.19.2 (devel branch) of rsyslog. Visit the rsyslog status page to obtain current version information and project status.

    If you like rsyslog, you might diff --git a/doc/professional_support.html b/doc/professional_support.html index 1a9e6524..2cb6c1e1 100644 --- a/doc/professional_support.html +++ b/doc/professional_support.html @@ -4,11 +4,11 @@ -

    Professional Support for Rsyslog

    -

    Professional Support is offered by Adiscon, the company -that sponsors rsyslog development. For details, please contact Adiscon Sales.

    -

    -

    EMail Support Service

    +

    Professional Services for Rsyslog

    +

    Professional services are being offered by Adiscon, the company +that sponsors rsyslog development. For details, please contact Adiscon Sales

    + +

    EMail Support Service

    Price: 99.00 EURO
    Duration: 180 days
    @@ -19,14 +19,19 @@ need to provide proof of software support in your organization. This contract provides

    • unlimited email support tickets during validity -
    • fixes for +
    • +
    • fixes for current and past rsyslog releases -
    • advise on how to implement rsyslog in the best possible way. -
    + +
  • advise on how to implement rsyslog in the best possible +way. +
  • +

    Under this contract, fixes for old rsyslog releases will be provided / created, provided that it is possible to do that with the -code base in question. Phone support is not included.

    Custom-Written Config File

    +code base in question. Phone support is not included.

    +

    Custom-Written Config File

    Price: 29.00 EURO
    Duration: N/A @@ -43,9 +48,35 @@ faster). For security reasons, we will not put passwords into the configuration file, but will place easy to read comments in the places where you need to put them in. The agreement is governed under German law. You may also purchase this service if you would like to have your -own configuration file reviewed, e.g. for auditing purposes.


    All agreements are +own configuration file reviewed, e.g. for auditing purposes.

    +

    Custom Development

    +

    Do you need an exotic feature that otherwise would not be implemented? +Do you need something really quick, quicker than it is available via +the regular development schedule? Then, you may consider funding +development for a specific functionality. We are always looking for +interesting projects. If you hire us to to do the job, you can be sure +to get the best possible and probably quickest solution, because we are +obviously at the heart of the source code. No need to get aquainted to +anything, no risk of misunderstanding program concepts. Benefit from +our vast syslog experience.

    +

    Please note that custom development is not limited to rsyslog. We offer +a number of logging solutions and can also work as part of your time +for specific requirements. The opportunities are endless, just ask. We +will work with you on your requirements and provide a quote on the +estimated cost. Just write to sales@adiscon.com for details.

    Consulting Services

    +

    Do you have demanding logging requirements? Why not talk to a +real logging professional? Instead of trying to find the solution +like a needle in the haystack, talk to the team that brought rsyslog, +phpLogCon, the Windows MonitorWare products and other logging +solutions. We sweat logging for over 15 years now and can help quickly. +Depending on your needs, consulting can be carried out via email, the +phone or on your premises (for larger or local projects). Everything is +possible, it just depends on your needs. Consulting services are +available in English and German. Just mail sales@adiscon.com what you are interested in and we will work with you on a proposal that fits your needs. +

    All agreements are governed under German law. -

    +

    +

    [manual index] [rsyslog site]

    This documentation is part of the rsyslog @@ -54,4 +85,4 @@ Copyright  Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.

    - + \ No newline at end of file diff --git a/doc/status.html b/doc/status.html index 3393c68c..03322a07 100644 --- a/doc/status.html +++ b/doc/status.html @@ -2,12 +2,12 @@ rsyslog status page

    rsyslog status page

    -

    This page reflects the status as of 2008-05-07.

    +

    This page reflects the status as of 2008-05-16.

    Current Releases

    -

    development: 3.19.1 - -change log - -download +

    development: 3.19.2 - +change log - +download
    beta: 3.17.2 - change log - @@ -16,8 +16,8 @@

    v3 stable: 3.16.1 - change log - download -
    v2 stable: 2.0.4 - change log - -download +
    v2 stable: 2.0.5 - change log - +download
    v0 and v1 are deprecated and no longer supported. If you absolutely do not like to upgrade, you may consider purchasing a commercial rsyslog support package. Just let us point -- cgit From 770b709654b5d10485480645acbe710e767db6bd Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 16 May 2008 14:53:12 +0200 Subject: fixed potential uninitialzed var access (highly improbable) --- runtime/nsdsel_gtls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/nsdsel_gtls.c b/runtime/nsdsel_gtls.c index 24c074f6..daa38929 100644 --- a/runtime/nsdsel_gtls.c +++ b/runtime/nsdsel_gtls.c @@ -135,6 +135,8 @@ doRetry(nsd_gtls_t *pNsd) break; default: assert(0); /* this shall not happen! */ + dbgprintf("ERROR: pNsd->rtryCall invalid in nsdsel_gtls.c:%d\n", __LINE__); + gnuRet = 0; /* if it happens, we have at least a defined behaviour... ;) */ break; } -- cgit From 7b69ee0ff8f096b0c6652df203918e29809720bb Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 16 May 2008 15:05:07 +0200 Subject: removed references to deleted files --- Makefile.am | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 61edc634..e4c4bea5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,10 +41,6 @@ lmgssutil_la_LIBADD = $(gss_libs) endif EXTRA_DIST = \ - redhat/rsyslog.conf \ - redhat/rsyslog.init \ - redhat/rsyslog.log \ - redhat/rsyslog.sysconfig \ freebsd/rsyslogd \ slackware/rc.rsyslogd \ contrib/README \ -- cgit From dfb1f20ce71e69bf164c9b1d59e0b4cd9f81c252 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 16 May 2008 15:11:14 +0200 Subject: bumped version number --- ChangeLog | 2 ++ configure.ac | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 71faebc1..ffe66f8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ --------------------------------------------------------------------------- +Version 3.19.3 (rgerhards), 2008-05-?? +--------------------------------------------------------------------------- Version 3.19.2 (rgerhards), 2008-05-16 - bugfix: TCP input modules did incorrectly set fromhost property (always blank) diff --git a/configure.ac b/configure.ac index a352da31..6b939f70 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],[3.19.2],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[3.19.3],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([ChangeLog]) AC_CONFIG_HEADERS([config.h]) -- cgit