diff --git a/.gitignore b/.gitignore index 49a418b..3b6963e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,21 @@ rsyslog-4.6.3.tar.gz /rsyslog-8.10.0.tar.gz /rsyslog-8.12.0.tar.gz /rsyslog-doc-8.12.0.tar.gz +/rsyslog-8.21.0.tar.gz +/rsyslog-doc-8.21.0.tar.gz +/rsyslog-doc-8.22.0.tar.gz +/rsyslog-8.22.0.tar.gz +/rsyslog-8.23.0.tar.gz +/rsyslog-doc-8.23.0.tar.gz +/rsyslog-8.24.0.tar.gz +/rsyslog-doc-8.24.0.tar.gz +/rsyslog-8.25.0.tar.gz +/rsyslog-doc-8.25.0.tar.gz +/rsyslog-8.26.0.tar.gz +/rsyslog-doc-8.26.0.tar.gz +/rsyslog-doc-8.27.0.tar.gz +/rsyslog-8.27.0.tar.gz +/rsyslog-8.29.0.tar.gz +/rsyslog-doc-8.29.0.tar.gz +/rsyslog-8.30.0.tar.gz +/rsyslog-doc-8.30.0.tar.gz diff --git a/rsyslog-8.10.0-imfile-maxlinesatonce.patch b/rsyslog-8.10.0-imfile-maxlinesatonce.patch deleted file mode 100644 index 3600c62..0000000 --- a/rsyslog-8.10.0-imfile-maxlinesatonce.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 20912054d062137a35a82962db7e53e1de2b819d Mon Sep 17 00:00:00 2001 -From: Tomas Heinrich -Date: Tue, 23 Jun 2015 13:48:43 +0200 -Subject: [PATCH 3/4] imfile: fix type overflow - -Data type of a configuration variable wasn't big enough for -eCmdHdlrSize. ---- - plugins/imfile/imfile.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c -index e3d0884..7e5ec62 100644 ---- a/plugins/imfile/imfile.c -+++ b/plugins/imfile/imfile.c -@@ -128,7 +128,7 @@ static struct configSettings_s { - int iFacility; /* local0 */ - int iSeverity; /* notice, as of rfc 3164 */ - int readMode; /* mode to use for ReadMultiLine call */ -- int maxLinesAtOnce; /* how many lines to process in a row? */ -+ int64 maxLinesAtOnce; /* how many lines to process in a row? */ - ruleset_t *pBindRuleset; /* ruleset to bind listener to (use system default if unspecified) */ - } cs; - --- -1.9.3 - diff --git a/rsyslog-8.10.0-imjournal-empty-messages.patch b/rsyslog-8.10.0-imjournal-empty-messages.patch deleted file mode 100644 index 8857c7f..0000000 --- a/rsyslog-8.10.0-imjournal-empty-messages.patch +++ /dev/null @@ -1,40 +0,0 @@ -From f1f77872ab6e962fcc7f53c0b51ef7b2d331c1bf Mon Sep 17 00:00:00 2001 -From: Tomas Heinrich -Date: Tue, 23 Jun 2015 18:09:52 +0200 -Subject: [PATCH 1/4] imjournal: don't sanitize empty messages - -It is an error to pass an empty message to -parser.SanitizeMsg() and doing so could crash the daemon. Besides, -there's no point in doing so in the first place. ---- - plugins/imjournal/imjournal.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c -index b5866e8..6ad9fca 100644 ---- a/plugins/imjournal/imjournal.c -+++ b/plugins/imjournal/imjournal.c -@@ -176,6 +176,7 @@ enqMsg(uchar *msg, uchar *pszTag, int iFacility, int iSeverity, struct timeval * - { - struct syslogTime st; - msg_t *pMsg; -+ size_t len; - DEFiRet; - - assert(msg != NULL); -@@ -189,8 +190,10 @@ enqMsg(uchar *msg, uchar *pszTag, int iFacility, int iSeverity, struct timeval * - } - MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY); - MsgSetInputName(pMsg, pInputName); -- MsgSetRawMsgWOSize(pMsg, (char*)msg); -- parser.SanitizeMsg(pMsg); -+ len = strlen((char*)msg); -+ MsgSetRawMsg(pMsg, (char*)msg, len); -+ if(len > 0) -+ parser.SanitizeMsg(pMsg); - MsgSetMSGoffs(pMsg, 0); /* we do not have a header... */ - MsgSetRcvFrom(pMsg, glbl.GetLocalHostNameProp()); - MsgSetRcvFromIP(pMsg, pLocalHostIP); --- -1.9.3 - diff --git a/rsyslog-8.10.0-resetconfigvariables.patch b/rsyslog-8.10.0-resetconfigvariables.patch deleted file mode 100644 index 82f7521..0000000 --- a/rsyslog-8.10.0-resetconfigvariables.patch +++ /dev/null @@ -1,99 +0,0 @@ -From 4f6456f536076b32802959506389cf69f2b08d03 Mon Sep 17 00:00:00 2001 -From: Tomas Heinrich -Date: Thu, 25 Jun 2015 18:20:54 +0200 -Subject: [PATCH 2/4] Harmonize resetConfigVariables values and defaults - -Default values for several global and main message queue parameters -were defined in two places which, over time, became inconsistent. -This merges the code used in resetConfigVariables and the rsconf_t -constructor. In cases where values for the same parameter differed, -the value with a more recent commit timestamp was used. ---- - runtime/rsconf.c | 49 ++++++++++++++++--------------------------------- - 1 file changed, 16 insertions(+), 33 deletions(-) - -diff --git a/runtime/rsconf.c b/runtime/rsconf.c -index d6e0bdf..c5b6132 100644 ---- a/runtime/rsconf.c -+++ b/runtime/rsconf.c -@@ -122,9 +122,10 @@ static struct cnfparamblk parserpblk = - /* forward-definitions */ - void cnfDoCfsysline(char *ln); - --/* Standard-Constructor -- */ --BEGINobjConstruct(rsconf) /* be sure to specify the object type also in END macro! */ -+void cnfSetDefaults(rsconf_t *pThis) -+{ -+ pThis->globals.bAbortOnUncleanConfig = 0; -+ pThis->globals.bReduceRepeatMsgs = 0; - pThis->globals.bDebugPrintTemplateList = 1; - pThis->globals.bDebugPrintModuleList = 0; - pThis->globals.bDebugPrintCfSysLineHandlerList = 0; -@@ -135,9 +136,6 @@ BEGINobjConstruct(rsconf) /* be sure to specify the object type also in END macr - pThis->templates.last = NULL; - pThis->templates.lastStatic = NULL; - pThis->actions.nbrActions = 0; -- lookupInitCnf(&pThis->lu_tabs); -- CHKiRet(llInit(&pThis->rulesets.llRulesets, rulesetDestructForLinkedList, -- rulesetKeyDestruct, strcasecmp)); - /* queue params */ - pThis->globals.mainQ.iMainMsgQueueSize = 100000; - pThis->globals.mainQ.iMainMsgQHighWtrMark = 80000; -@@ -161,7 +159,16 @@ BEGINobjConstruct(rsconf) /* be sure to specify the object type also in END macr - pThis->globals.mainQ.bMainMsgQSaveOnShutdown = 1; - pThis->globals.mainQ.iMainMsgQueueDeqtWinFromHr = 0; - pThis->globals.mainQ.iMainMsgQueueDeqtWinToHr = 25; -- /* end queue params */ -+} -+ -+ -+/* Standard-Constructor -+ */ -+BEGINobjConstruct(rsconf) /* be sure to specify the object type also in END macro! */ -+ cnfSetDefaults(pThis); -+ lookupInitCnf(&pThis->lu_tabs); -+ CHKiRet(llInit(&pThis->rulesets.llRulesets, rulesetDestructForLinkedList, -+ rulesetKeyDestruct, strcasecmp)); - finalize_it: - ENDobjConstruct(rsconf) - -@@ -967,33 +974,9 @@ finalize_it: - /* legacy config system: reset config variables to default values. */ - static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) - { -- loadConf->globals.bLogStatusMsgs = DFLT_bLogStatusMsgs; -- loadConf->globals.bDebugPrintTemplateList = 1; -- loadConf->globals.bDebugPrintCfSysLineHandlerList = 1; -- loadConf->globals.bDebugPrintModuleList = 1; -- loadConf->globals.bAbortOnUncleanConfig = 0; -- loadConf->globals.bReduceRepeatMsgs = 0; - free(loadConf->globals.mainQ.pszMainMsgQFName); -- loadConf->globals.mainQ.pszMainMsgQFName = NULL; -- loadConf->globals.mainQ.iMainMsgQueueSize = 10000; -- loadConf->globals.mainQ.iMainMsgQHighWtrMark = 8000; -- loadConf->globals.mainQ.iMainMsgQLowWtrMark = 2000; -- loadConf->globals.mainQ.iMainMsgQDiscardMark = 9800; -- loadConf->globals.mainQ.iMainMsgQDiscardSeverity = 8; -- loadConf->globals.mainQ.iMainMsgQueMaxFileSize = 1024 * 1024; -- loadConf->globals.mainQ.iMainMsgQueueNumWorkers = 1; -- loadConf->globals.mainQ.iMainMsgQPersistUpdCnt = 0; -- loadConf->globals.mainQ.bMainMsgQSyncQeueFiles = 0; -- loadConf->globals.mainQ.iMainMsgQtoQShutdown = 1500; -- loadConf->globals.mainQ.iMainMsgQtoActShutdown = 1000; -- loadConf->globals.mainQ.iMainMsgQtoEnq = 2000; -- loadConf->globals.mainQ.iMainMsgQtoWrkShutdown = 60000; -- loadConf->globals.mainQ.iMainMsgQWrkMinMsgs = 100; -- loadConf->globals.mainQ.iMainMsgQDeqSlowdown = 0; -- loadConf->globals.mainQ.bMainMsgQSaveOnShutdown = 1; -- loadConf->globals.mainQ.MainMsgQueType = QUEUETYPE_FIXED_ARRAY; -- loadConf->globals.mainQ.iMainMsgQueMaxDiskSpace = 0; -- loadConf->globals.mainQ.iMainMsgQueDeqBatchSize = 32; -+ -+ cnfSetDefaults(loadConf); - - return RS_RET_OK; - } --- -1.9.3 - diff --git a/rsyslog-8.12.0-gnutls-detection.patch b/rsyslog-8.12.0-gnutls-detection.patch deleted file mode 100644 index cf645f2..0000000 --- a/rsyslog-8.12.0-gnutls-detection.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up ./configure.ac.fix ./configure.ac ---- ./configure.ac.fix 2015-08-10 12:25:41.000000000 +0200 -+++ ./configure.ac 2015-08-31 10:35:18.515110190 +0200 -@@ -763,17 +763,11 @@ AC_ARG_ENABLE(gnutls, - if test "x$enable_gnutls" = "xyes"; then - PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.0) - AC_DEFINE([ENABLE_GNUTLS], [1], [Indicator that GnuTLS is present]) -- AC_CHECK_LIB( -- [gnutls], -- [gnutls_global_init], -- [ -- AC_DEFINE(HAVE_LIB_GNUTLS, 1, [gnutls is available]) -- ], -- [AC_MSG_WARN([gnutls_global_init function missing or not detected])], -- [] -- ) -+ save_libs=$LIBS -+ LIBS="$LIBS $GNUTLS_LIBS" - AC_CHECK_FUNCS(gnutls_certificate_set_retrieve_function,,) - AC_CHECK_FUNCS(gnutls_certificate_type_set_priority,,) -+ LIBS=$save_libs - fi - AM_CONDITIONAL(ENABLE_GNUTLS, test x$enable_gnutls = xyes) - diff --git a/rsyslog-8.23.0-msg_c_nonoverwrite_merge.patch b/rsyslog-8.23.0-msg_c_nonoverwrite_merge.patch new file mode 100644 index 0000000..1ca26ff --- /dev/null +++ b/rsyslog-8.23.0-msg_c_nonoverwrite_merge.patch @@ -0,0 +1,65 @@ +From fa7d98b0cb0512d84355e3aafdc5a3e366842f2a Mon Sep 17 00:00:00 2001 +From: Radovan Sroka +Date: Mon, 21 Nov 2016 13:38:18 +0100 +Subject: [PATCH 2/4] Rebased from: Patch2: + rsyslog-7.2.1-msg_c_nonoverwrite_merge.patch + +Resolves: + no adressed bugzila +--- + runtime/msg.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +diff --git a/runtime/msg.c b/runtime/msg.c +index f6e017b..5430331 100644 +--- a/runtime/msg.c ++++ b/runtime/msg.c +@@ -4632,6 +4632,27 @@ finalize_it: + RETiRet; + } + ++static rsRetVal jsonMerge(struct json_object *existing, struct json_object *json); ++ ++static rsRetVal ++jsonMergeNonOverwrite(struct json_object *existing, struct json_object *json) ++{ ++ DEFiRet; ++ ++ struct json_object_iterator it = json_object_iter_begin(existing); ++ struct json_object_iterator itEnd = json_object_iter_end(existing); ++ while (!json_object_iter_equal(&it, &itEnd)) { ++ json_object_object_add(json, json_object_iter_peek_name(&it), ++ json_object_get(json_object_iter_peek_value(&it))); ++ json_object_iter_next(&it); ++ } ++ ++ CHKiRet(jsonMerge(existing, json)); ++finalize_it: ++ RETiRet; ++} ++ ++ + static rsRetVal + jsonMerge(struct json_object *existing, struct json_object *json) + { +@@ -4714,7 +4735,7 @@ msgAddJSON(msg_t * const pM, uchar *name, struct json_object *json, int force_re + if(*pjroot == NULL) + *pjroot = json; + else +- CHKiRet(jsonMerge(*pjroot, json)); ++ CHKiRet(jsonMergeNonOverwrite(*pjroot, json)); + } else { + if(*pjroot == NULL) { + /* now we need a root obj */ +@@ -4742,7 +4763,7 @@ msgAddJSON(msg_t * const pM, uchar *name, struct json_object *json, int force_re + json_object_object_add(parent, (char*)leaf, json); + } else { + if(json_object_get_type(json) == json_type_object) { +- CHKiRet(jsonMerge(*pjroot, json)); ++ CHKiRet(jsonMergeNonOverwrite(*pjroot, json)); + } else { + /* TODO: improve the code below, however, the current + * state is not really bad */ +-- +2.7.4 + diff --git a/rsyslog-8.30.0-imgssapi-compile-error.patch b/rsyslog-8.30.0-imgssapi-compile-error.patch new file mode 100644 index 0000000..8427aea --- /dev/null +++ b/rsyslog-8.30.0-imgssapi-compile-error.patch @@ -0,0 +1,128 @@ +From 8d793eafdde0b74d0b4424f0d194b5dc6801a5d1 Mon Sep 17 00:00:00 2001 +From: Rainer Gerhards +Date: Tue, 17 Oct 2017 17:34:49 +0200 +Subject: [PATCH] imgssapi: fix compiler warnings + +--- + plugins/imgssapi/imgssapi.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +diff --git a/plugins/imgssapi/imgssapi.c b/plugins/imgssapi/imgssapi.c +index aafce7d2..836931c7 100644 +--- a/plugins/imgssapi/imgssapi.c ++++ b/plugins/imgssapi/imgssapi.c +@@ -9,7 +9,7 @@ + * NOTE: read comments in module-template.h to understand how this file + * works! + * +- * Copyright 2007, 2014 Rainer Gerhards and Adiscon GmbH. ++ * Copyright 2007, 2017 Rainer Gerhards and Adiscon GmbH. + * + * This file is part of rsyslog. + * +@@ -63,7 +63,6 @@ + + MODULE_TYPE_INPUT + MODULE_TYPE_NOKEEP +-MODULE_CNFNAME("imgssapi") + + /* defines */ + #define ALLOWEDMETHOD_GSS 2 +@@ -162,7 +161,7 @@ OnSessDestruct(void *ppUsr) + OM_uint32 maj_stat, min_stat; + maj_stat = gss_delete_sec_context(&min_stat, &(*ppGSess)->gss_context, GSS_C_NO_BUFFER); + if (maj_stat != GSS_S_COMPLETE) +- gssutil.display_status("deleting context", maj_stat, min_stat); ++ gssutil.display_status((char*)"deleting context", maj_stat, min_stat); + } + + free(*ppGSess); +@@ -291,7 +290,7 @@ finalize_it: + + + static rsRetVal +-doRcvData(tcps_sess_t *pSess, char *buf, size_t lenBuf, ssize_t *piLenRcvd) ++doRcvData(tcps_sess_t *pSess, char *buf, size_t lenBuf, ssize_t *piLenRcvd, int *const oserr) + { + DEFiRet; + int allowedMethods; +@@ -307,7 +306,7 @@ doRcvData(tcps_sess_t *pSess, char *buf, size_t lenBuf, ssize_t *piLenRcvd) + CHKiRet(TCPSessGSSRecv(pSess, buf, lenBuf, piLenRcvd)); + } else { + *piLenRcvd = lenBuf; +- CHKiRet(netstrm.Rcv(pSess->pStrm, (uchar*) buf, piLenRcvd) != RS_RET_OK); ++ CHKiRet(netstrm.Rcv(pSess->pStrm, (uchar*) buf, piLenRcvd, oserr)); + } + + finalize_it: +@@ -380,11 +379,11 @@ static int TCPSessGSSInit(void) + if (gss_server_creds != GSS_C_NO_CREDENTIAL) + return 0; + +- name_buf.value = (gss_listen_service_name == NULL) ? "host" : gss_listen_service_name; ++ name_buf.value = (gss_listen_service_name == NULL) ? (char*)"host" : gss_listen_service_name; + name_buf.length = strlen(name_buf.value) + 1; + maj_stat = gss_import_name(&min_stat, &name_buf, GSS_C_NT_HOSTBASED_SERVICE, &server_name); + if (maj_stat != GSS_S_COMPLETE) { +- gssutil.display_status("importing name", maj_stat, min_stat); ++ gssutil.display_status((char*)"importing name", maj_stat, min_stat); + return -1; + } + +@@ -392,7 +391,7 @@ static int TCPSessGSSInit(void) + GSS_C_NULL_OID_SET, GSS_C_ACCEPT, + &gss_server_creds, NULL, NULL); + if (maj_stat != GSS_S_COMPLETE) { +- gssutil.display_status("acquiring credentials", maj_stat, min_stat); ++ gssutil.display_status((char*)"acquiring credentials", maj_stat, min_stat); + return -1; + } + +@@ -549,7 +548,7 @@ OnSessAcceptGSS(tcpsrv_t *pThis, tcps_sess_t *pSess) + pGSess->allowedMethods = ALLOWEDMETHOD_TCP; + ABORT_FINALIZE(RS_RET_OK); // TODO: define good error codes + } +- gssutil.display_status("accepting context", maj_stat, acc_sec_min_stat); ++ gssutil.display_status((char*)"accepting context", maj_stat, acc_sec_min_stat); + ABORT_FINALIZE(RS_RET_ERR); // TODO: define good error codes + } + if (send_tok.length != 0) { +@@ -566,7 +565,7 @@ OnSessAcceptGSS(tcpsrv_t *pThis, tcps_sess_t *pSess) + + maj_stat = gss_display_name(&min_stat, client, &recv_tok, NULL); + if (maj_stat != GSS_S_COMPLETE) { +- gssutil.display_status("displaying name", maj_stat, min_stat); ++ gssutil.display_status((char*)"displaying name", maj_stat, min_stat); + } else { + dbgprintf("GSS-API Accepted connection from peer %s: %s\n", (char *)pszPeer, (char*) recv_tok.value); + } +@@ -608,7 +607,7 @@ int TCPSessGSSRecv(tcps_sess_t *pSess, void *buf, size_t buf_len, ssize_t *piLen + maj_stat = gss_unwrap(&min_stat, *context, &xmit_buf, &msg_buf, + &conf_state, (gss_qop_t *) NULL); + if(maj_stat != GSS_S_COMPLETE) { +- gssutil.display_status("unsealing message", maj_stat, min_stat); ++ gssutil.display_status((char*)"unsealing message", maj_stat, min_stat); + if(xmit_buf.value) { + free(xmit_buf.value); + xmit_buf.value = 0; +@@ -644,7 +643,7 @@ void TCPSessGSSClose(tcps_sess_t* pSess) + context = &pGSess->gss_context; + maj_stat = gss_delete_sec_context(&min_stat, context, GSS_C_NO_BUFFER); + if (maj_stat != GSS_S_COMPLETE) +- gssutil.display_status("deleting context", maj_stat, min_stat); ++ gssutil.display_status((char*)"deleting context", maj_stat, min_stat); + *context = GSS_C_NO_CONTEXT; + pGSess->gss_flags = 0; + pGSess->allowedMethods = 0; +@@ -665,7 +664,7 @@ TCPSessGSSDeinit(void) + if (gss_server_creds != GSS_C_NO_CREDENTIAL) { + maj_stat = gss_release_cred(&min_stat, &gss_server_creds); + if (maj_stat != GSS_S_COMPLETE) +- gssutil.display_status("releasing credentials", maj_stat, min_stat); ++ gssutil.display_status((char*)"releasing credentials", maj_stat, min_stat); + } + RETiRet; + } +-- +2.13.6 + diff --git a/rsyslog-8.30.0-imjournal-fix.patch b/rsyslog-8.30.0-imjournal-fix.patch new file mode 100644 index 0000000..a786b8c --- /dev/null +++ b/rsyslog-8.30.0-imjournal-fix.patch @@ -0,0 +1,77 @@ +From 4736e53d471ac45024333588fcdf5bce5f8c61b8 Mon Sep 17 00:00:00 2001 +From: Rainer Gerhards +Date: Wed, 25 Oct 2017 11:09:40 +0200 +Subject: [PATCH] imjournal bugfix: module did not work at all + +The open function was broken by commit 92ac801 (v8.30.0), +resulting in no data being ever read from the journal. + +patch bases on the idea of Radovan Sroka given here: +https://github.com/rsyslog/rsyslog/issues/1895#issuecomment-339017357 +but follows the current imjournal-paradigm of having the journal +handle inside a global variable. + +see also https://github.com/rsyslog/rsyslog/issues/1895 +closes https://github.com/rsyslog/rsyslog/issues/1897 +--- + plugins/imjournal/imjournal.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c +index 8f043d5e1..2f1569837 100644 +--- a/plugins/imjournal/imjournal.c ++++ b/plugins/imjournal/imjournal.c +@@ -118,20 +118,20 @@ static sd_journal *j; + static rsRetVal persistJournalState(void); + static rsRetVal loadJournalState(void); + +-static rsRetVal openJournal(sd_journal* jj) { ++static rsRetVal openJournal(void) { + DEFiRet; + +- if (sd_journal_open(&jj, SD_JOURNAL_LOCAL_ONLY) < 0) ++ if (sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY) < 0) + iRet = RS_RET_IO_ERROR; + RETiRet; + } + +-static void closeJournal(sd_journal* jj) { ++static void closeJournal(void) { + + if (cs.stateFile) { /* can't persist without a state file */ + persistJournalState(); + } +- sd_journal_close(jj); ++ sd_journal_close(j); + } + + +@@ -513,10 +513,10 @@ pollJournal(void) + /* do not persist stateFile sd_journal_get_cursor will fail! */ + char* tmp = cs.stateFile; + cs.stateFile = NULL; +- closeJournal(j); ++ closeJournal(); + cs.stateFile = tmp; + +- iRet = openJournal(j); ++ iRet = openJournal(); + if (iRet != RS_RET_OK) { + char errStr[256]; + rs_strerror_r(errno, errStr, sizeof(errStr)); +@@ -773,13 +773,13 @@ ENDfreeCnf + /* open journal */ + BEGINwillRun + CODESTARTwillRun +- iRet = openJournal(j); ++ iRet = openJournal(); + ENDwillRun + + /* close journal */ + BEGINafterRun + CODESTARTafterRun +- closeJournal(j); ++ closeJournal(); + ratelimitDestruct(ratelimiter); + ENDafterRun + diff --git a/rsyslog-8.8.0-imjournal-dflt-pri.patch b/rsyslog-8.8.0-imjournal-dflt-pri.patch deleted file mode 100644 index 738d52d..0000000 --- a/rsyslog-8.8.0-imjournal-dflt-pri.patch +++ /dev/null @@ -1,27 +0,0 @@ -From f88f5d4f7e57a6f41b01d4e06f8d40dee4c0dbad Mon Sep 17 00:00:00 2001 -From: Tomas Heinrich -Date: Fri, 20 Mar 2015 18:17:05 +0100 -Subject: [PATCH] imjournal: fix default message priority - ---- - plugins/imjournal/imjournal.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c -index 7c2c2fa..b5866e8 100644 ---- a/plugins/imjournal/imjournal.c -+++ b/plugins/imjournal/imjournal.c -@@ -97,8 +97,8 @@ static struct cnfparamblk modpblk = - }; - - #define DFLT_persiststateinterval 10 --#define DFLT_SEVERITY pri2fac(LOG_NOTICE) --#define DFLT_FACILITY pri2sev(LOG_USER) -+#define DFLT_SEVERITY pri2sev(LOG_NOTICE) -+#define DFLT_FACILITY pri2fac(LOG_USER) - - static int bLegacyCnfModGlobalsPermitted = 1;/* are legacy module-global config parameters permitted? */ - --- -1.9.3 - diff --git a/rsyslog-8.8.0-immutable-json-props.patch b/rsyslog-8.8.0-immutable-json-props.patch deleted file mode 100644 index b47ebfe..0000000 --- a/rsyslog-8.8.0-immutable-json-props.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -up ./runtime/msg.c.orig ./runtime/msg.c ---- a/runtime/msg.c 2015-01-15 19:30:02.351699869 +0100 -+++ b/runtime/msg.c 2015-01-15 19:35:58.667176642 +0100 -@@ -4267,22 +4267,19 @@ jsonPathFindParent(struct json_object *j - RETiRet; - } - -+/* In case of duplicate names, the original value is kept. */ - static rsRetVal - jsonMerge(struct json_object *existing, struct json_object *json) - { -- /* TODO: check & handle duplicate names */ - DEFiRet; - struct json_object_iter it; - -- json_object_object_foreachC(json, it) { -- json_object_object_add(existing, it.key, -- json_object_get(it.val)); -+ json_object_object_foreachC(existing, it) { -+ json_object_object_add(json, it.key, json_object_get(it.val)); - } -- /* note: json-c does ref counting. We added all descandants refcounts -- * in the loop above. So when we now free(_put) the root object, only -- * root gets freed(). -- */ -- json_object_put(json); -+ -+ iRet = jsonMerge(existing, json); -+ - RETiRet; - } - diff --git a/rsyslog-8.8.0-missing-test-data.patch b/rsyslog-8.8.0-missing-test-data.patch deleted file mode 100644 index 8042de5..0000000 --- a/rsyslog-8.8.0-missing-test-data.patch +++ /dev/null @@ -1,45 +0,0 @@ -From e07210a7eb47df978b958d1489b91084732fdd47 Mon Sep 17 00:00:00 2001 -From: Tomas Heinrich -Date: Sun, 15 Mar 2015 16:25:33 +0100 -Subject: [PATCH] Add missing test data - ---- - tests/testsuites/mmnormalize_regex.rulebase | 1 + - tests/testsuites/mmnormalize_tokenized.rulebase | 5 +++++ - tests/testsuites/mmnormalize_variable.rulebase | 1 + - 3 files changed, 7 insertions(+) - create mode 100644 tests/testsuites/mmnormalize_regex.rulebase - create mode 100644 tests/testsuites/mmnormalize_tokenized.rulebase - create mode 100644 tests/testsuites/mmnormalize_variable.rulebase - -diff --git a/tests/testsuites/mmnormalize_regex.rulebase b/tests/testsuites/mmnormalize_regex.rulebase -new file mode 100644 -index 0000000..f58e8f2 ---- /dev/null -+++ b/tests/testsuites/mmnormalize_regex.rulebase -@@ -0,0 +1 @@ -+rule=:http host ports are %hps:regex:([0-9.\x3a]+(, )?)+% etc -\ No newline at end of file -diff --git a/tests/testsuites/mmnormalize_tokenized.rulebase b/tests/testsuites/mmnormalize_tokenized.rulebase -new file mode 100644 -index 0000000..da5242d ---- /dev/null -+++ b/tests/testsuites/mmnormalize_tokenized.rulebase -@@ -0,0 +1,5 @@ -+rule=only_ips:%only_ips:tokenized:, :ipv4% -+rule=local_ips:local ips are %local_ips:tokenized:, :ipv4% -+rule=external_ips:%external_ips:tokenized:, :ipv4% are external ips -+rule=paths:for %user:char-to:@%@localhost path was %fragments:tokenized:\x3a:char-sep:\x3a% -+rule=recur_comma_colon_nos:comma separated list of colon separated numbers: %some_nos:tokenized:, :tokenized: \x3a :tokenized:#:number% -\ No newline at end of file -diff --git a/tests/testsuites/mmnormalize_variable.rulebase b/tests/testsuites/mmnormalize_variable.rulebase -new file mode 100644 -index 0000000..4d40d4c ---- /dev/null -+++ b/tests/testsuites/mmnormalize_variable.rulebase -@@ -0,0 +1 @@ -+rule=hms:%hr:number%:%min:number%:%sec:number% %zone:word% -\ No newline at end of file --- -1.9.3 - diff --git a/rsyslog.conf b/rsyslog.conf index f44dd62..86ade8c 100644 --- a/rsyslog.conf +++ b/rsyslog.conf @@ -1,53 +1,40 @@ # rsyslog configuration file # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html +# or latest version online at http://www.rsyslog.com/doc/rsyslog_conf.html # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html #### MODULES #### -# The imjournal module bellow is now used as a message source instead of imuxsock. -$ModLoad imjournal # provides access to the systemd journal -#$ModLoad imklog # provides kernel logging support (previously done by rklogd) -#$ModLoad immark # provides --MARK-- message capability +module(load="imuxsock" # provides support for local system logging (e.g. via logger command) + SysSock.Use="off") # Turn off message reception via local log socket; + # local messages are retrieved through imjournal now. +module(load="imjournal" # provides access to the systemd journal + StateFile="imjournal.state") # File to store the position in the journal +#module(load="imklog") # reads kernel messages (the same are read from journald) +#module(load"immark") # provides --MARK-- message capability # Provides UDP syslog reception -#$ModLoad imudp -#$UDPServerRun 514 +# for parameters see http://www.rsyslog.com/doc/imudp.html +#module(load="imudp") # needs to be done just once +#input(type="imudp" port="514") # Provides TCP syslog reception -#$ModLoad imtcp -#$InputTCPServerRun 514 - -# By default, all system logs are read from journald through the -# imjournal module. To read messages from the syslog socket, the -# imuxsock module has to be loaded and a path to the socket specified. -#$ModLoad imuxsock -# The default path to the syslog socket provided by journald: -#$SystemLogSocketName /run/systemd/journal/syslog - +# for parameters see http://www.rsyslog.com/doc/imtcp.html +#module(load="imtcp") # needs to be done just once +#input(type="imtcp" port="514") #### GLOBAL DIRECTIVES #### # Where to place auxiliary files -$WorkDirectory /var/lib/rsyslog +global(workDirectory="/var/lib/rsyslog") # Use default timestamp format -$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat - -# File syncing capability is disabled by default. This feature is usually not required, -# not useful and an extreme performance hit -#$ActionFileEnableSync on +module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat") # Include all config files in /etc/rsyslog.d/ $IncludeConfig /etc/rsyslog.d/*.conf -# File to store the position in the journal -$IMJournalStateFile imjournal.state -# If there is no saved state yet, don't read in the whole bulk of messages. -# This means some of the older messages won't be collected by rsyslog, -# but it also prevents a potential huge spike in resource utilization. -$IMJournalIgnorePreviousMessages on - #### RULES #### # Log all kernel messages to the console. @@ -78,19 +65,15 @@ uucp,news.crit /var/log/spooler local7.* /var/log/boot.log -# ### begin forwarding rule ### -# The statement between the begin ... end define a SINGLE forwarding -# rule. They belong together, do NOT split them. If you create multiple -# forwarding rules, duplicate the whole block! -# Remote Logging (we use TCP for reliable delivery) -# +# ### sample forwarding rule ### +#action(type="omfwd" # An on-disk queue is created for this action. If the remote host is # down, messages are spooled to disk and sent when it is up again. -#$ActionQueueFileName fwdRule1 # unique name prefix for spool files -#$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible) -#$ActionQueueSaveOnShutdown on # save messages to disk on shutdown -#$ActionQueueType LinkedList # run asynchronously -#$ActionResumeRetryCount -1 # infinite retries if host is down -# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional -#*.* @@remote-host:514 -# ### end of the forwarding rule ### +#queue.filename="fwdRule1" # unique name prefix for spool files +#queue.maxdiskspace="1g" # 1gb space limit (use as much as possible) +#queue.saveonshutdown="on" # save messages to disk on shutdown +#queue.type="LinkedList" # run asynchronously +#action.resumeRetryCount="-1" # infinite retries if host is down +# Remote Logging (we use TCP for reliable delivery) +# remote_host is: name/ip, e.g. 192.168.0.1, port optional e.g. 10514 +#Target="remote_host" Port="XXX" Protocol="tcp") diff --git a/rsyslog.spec b/rsyslog.spec index 470b8e0..c245aaa 100644 --- a/rsyslog.spec +++ b/rsyslog.spec @@ -8,10 +8,14 @@ %global want_hiredis 1 %global want_mongodb 1 %endif +#due to multiple failures of extensive testbench on various archs +#and module requirements of certain tests need to have it disabled, +#tests execution possible locally on properly set up workstation +%global want_testbench 0 Summary: Enhanced system logging and kernel message trapping daemon Name: rsyslog -Version: 8.12.0 +Version: 8.30.0 Release: 3%{?dist} License: (GPLv3+ and ASL 2.0) Group: System Environment/Daemons @@ -21,20 +25,14 @@ Source1: http://www.rsyslog.com/files/download/rsyslog/%{name}-doc-%{version}.ta Source2: rsyslog.conf Source3: rsyslog.sysconfig Source4: rsyslog.log -# tweak the upstream service file to honour configuration from /etc/sysconfig/rsyslog -Patch0: rsyslog-8.8.0-sd-service.patch -# prevent modification of trusted properties (proposed upstream) -Patch1: rsyslog-8.8.0-immutable-json-props.patch -# Fix detection of the GnuTLS package -# https://github.com/rsyslog/rsyslog/pull/476 -Patch2: rsyslog-8.12.0-gnutls-detection.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bison BuildRequires: dos2unix BuildRequires: flex -BuildRequires: json-c-devel +BuildRequires: libgcrypt-devel +BuildRequires: libfastjson-devel BuildRequires: libestr-devel >= 0.1.9 BuildRequires: liblogging-stdlog-devel BuildRequires: libtool @@ -44,6 +42,7 @@ BuildRequires: python-docutils # make sure systemd is in a version that isn't affected by rhbz#974132 BuildRequires: systemd-devel >= 204-8 BuildRequires: zlib-devel +BuildRequires: qpid-proton-c-devel Requires: logrotate >= 3.5.2 Requires: bash >= 2.0 @@ -54,15 +53,21 @@ Requires(postun): systemd Provides: syslog Obsoletes: sysklogd < 1.5-11 +# tweak the upstream service file to honour configuration from /etc/sysconfig/rsyslog +Patch0: rsyslog-8.8.0-sd-service.patch +Patch1: rsyslog-8.23.0-msg_c_nonoverwrite_merge.patch +Patch2: rsyslog-8.30.0-imgssapi-compile-error.patch +Patch3: rsyslog-8.30.0-imjournal-fix.patch + %package crypto Summary: Encryption support Group: System Environment/Daemons Requires: %name = %version-%release -BuildRequires: libgcrypt-devel %package doc Summary: HTML documentation for rsyslog Group: Documentation +BuildArch: noarch %package elasticsearch Summary: ElasticSearch output module for rsyslog @@ -161,6 +166,18 @@ Group: System Environment/Daemons Requires: %name = %version-%release BuildRequires: libnet-devel +%package omamqp1 +Summary: Provides the omamqp1 module +Group: System Environment/Daemons +Requires: %name = %version-%release +BuildRequires: qpid-proton-c-devel + +%package kafka +Summary: Provides the omkafka module +Group: System Environment/Daemons +Requires: %name = %version-%release +BuildRequires: librdkafka-devel + %description Rsyslog is an enhanced, multi-threaded syslog daemon. It supports MySQL, syslog/TCP, RFC 3195, permitted sender lists, filtering on any message part, @@ -246,6 +263,13 @@ This module is similar to the regular UDP forwarder, but permits to spoof the sender address. Also, it enables to circle through a number of source ports. +%description omamqp1 +The omamqp1 output module can be used to send log messages via an AMQP +1.0-compatible messaging bus. + +%description kafka +The rsyslog-kafka package provides module for Apache Kafka output. + %prep # set up rsyslog-doc sources %setup -q -a 1 -T -c @@ -256,6 +280,7 @@ mv build doc %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 autoreconf -iv @@ -277,6 +302,9 @@ export HIREDIS_LIBS="-L%{_libdir} -lhiredis" %configure \ --prefix=/usr \ --disable-static \ +%if %{want_testbench} + --enable-testbench \ +%endif --enable-elasticsearch \ --enable-generate-man-pages \ --enable-gnutls \ @@ -295,6 +323,7 @@ export HIREDIS_LIBS="-L%{_libdir} -lhiredis" --enable-mmnormalize \ --enable-mmsnmptrapd \ --enable-mysql \ + --enable-omamqp1 \ %if %{want_hiredis} --enable-omhiredis \ %endif @@ -311,23 +340,17 @@ export HIREDIS_LIBS="-L%{_libdir} -lhiredis" --enable-pmaixforwardedfrom \ --enable-pmcisconames \ --enable-pmlastmsg \ - --enable-pmrfc3164sd \ --enable-pmsnare \ --enable-relp \ --enable-snmp \ - --enable-testbench \ --enable-unlimited-select \ --enable-usertools \ + --enable-omkafka \ make V=1 -# small portion of the test suite seems to be consistently failing (this is more severe on arm*) -# there are also some random failures (~1 test out of the whole batch) on i686 and x86_64 -# thus the test suite is disabled for now until these issues are sorted out %check -%if 0 make V=1 check -%endif %install make V=1 DESTDIR=%{buildroot} install @@ -341,7 +364,7 @@ install -d -m 755 %{buildroot}%{rsyslog_docdir}/html install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/rsyslog.conf install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/rsyslog -install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/syslog +install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/rsyslog install -p -m 644 plugins/ommysql/createDB.sql %{buildroot}%{rsyslog_docdir}/mysql-createDB.sql install -p -m 644 plugins/ompgsql/createDB.sql %{buildroot}%{rsyslog_docdir}/pgsql-createDB.sql dos2unix tools/recover_qi.pl @@ -352,8 +375,9 @@ cp -r doc/* %{buildroot}%{rsyslog_docdir}/html rm -f %{buildroot}%{_libdir}/rsyslog/*.la # get rid of socket activation by default sed -i '/^Alias/s/^/;/;/^Requires=syslog.socket/s/^/;/' %{buildroot}%{_unitdir}/rsyslog.service -# imdiag is only used for testing +# imdiag and liboverride is only used for testing rm -f %{buildroot}%{_libdir}/rsyslog/imdiag.so +rm -f %{buildroot}%{_libdir}/rsyslog/liboverride_gethostname.so %post for n in /var/log/{messages,secure,maillog,spooler} @@ -388,7 +412,7 @@ done %{_unitdir}/rsyslog.service %config(noreplace) %{_sysconfdir}/rsyslog.conf %config(noreplace) %{_sysconfdir}/sysconfig/rsyslog -%config(noreplace) %{_sysconfdir}/logrotate.d/syslog +%config(noreplace) %{_sysconfdir}/logrotate.d/rsyslog # plugins %{_libdir}/rsyslog/imfile.so %{_libdir}/rsyslog/imjournal.so @@ -505,7 +529,107 @@ done %defattr(-,root,root) %{_libdir}/rsyslog/omudpspoof.so +%files omamqp1 +%defattr(-,root,root) +%{_libdir}/rsyslog/omamqp1.so + +%files kafka +%defattr(-,root,root) +%{_libdir}/rsyslog/omkafka.so + %changelog +* Tue Nov 28 2017 Jiri Vymazal - 8.30.0-3 +- changed rsyslog-doc to noarch + +* Wed Oct 25 2017 Radovan Sroka - 8.30.0-3 +- rebuild + +* Wed Oct 25 2017 Radovan Sroka - 8.30.0-2 +- imjournal didn't work at all +- added imjournal patch for rhbz#1505853 + +* Mon Oct 23 2017 Radovan Sroka - 8.30.0-1 +- rebase to 8.30.0 +- added patch that resolves imgssapi compilation errors + +* Wed Aug 16 2017 Radovan Sroka - 8.29.0-2 +- rebuild + +* Tue Aug 15 2017 Marek Tamaskovic - 8.29.0-1 +- rebase to 8.29.0 + +* Mon May 22 2017 Radovan Sroka - 8.27.0-1 +- dropped patch2 (upstreamed) +- rebase to 8.27.0 + +* Tue Apr 18 2017 Radovan Sroka - 8.26.0-1 +- rebase to 8.26.0 +- added doc patch rhbz#1436113 +- dropped chdir patch, https://github.com/rsyslog/rsyslog/pull/1420 +- moved dependency libgcrypt to rsyslog core + +* Wed Mar 01 2017 Jiri Vymazal - 8.25.0-2 +- rebased doc subpackage to 8.25.0 as well +- dropped upstreamed doc patch + +* Tue Feb 28 2017 Jiri Vymazal - 8.25.0-1 +- rebase to 8.25.0 upstream source version + +* Mon Feb 27 2017 Jiri Vymazal - 8.24.0-7 +- forced rebuild because of libqpid-proton rebase + +* Mon Feb 20 2017 Jiri Vymazal - 8.24.0-6 +- fixed typo in chdir location + resolves: rhbz#1422542 +- updated one more directive in default config + resolves: rhbz#1419625 + +* Fri Feb 17 2017 Jiri Vymazal - 8.24.0-5 +- new default config, using RainerScript wherever possible + resolves: rhbz#1419625 +- updated testbench guard as testbench now needs explicit configuration + see: rhbz#1211194 +- added patch to make chdir call after chroot + resolves: rhbz#1422542 + +* Sat Feb 11 2017 Fedora Release Engineering - 8.24.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Feb 03 2017 Jiri Vymazal - 8.24.0-3 +- new kafka sub-package, adding omkafka module + see: rhbz#1418720 + +* Mon Jan 16 2017 Jiri Vymazal - 8.24.0-2 +- reverted symlink to syslog.service - not needed + see: rhbz#1343132 + +* Fri Jan 13 2017 Jiri Vymazal - 8.24.0-1 +- rsyslog rebase to 8.24 +- changed name of created file in logrotate.d to non-generic one + resolves: rhbz1269244 +- added symlink to syslog.service + resolves: rhbz1343132 +- added documentation for recover_qi + resolves: rhbz1286707 +- changed default .conf added imuxsock, seqfault is not present anymore + https://github.com/rsyslog/rsyslog/pull/1289 + +* Tue Dec 20 2016 Radovan Sroka - 8.23.0-2 +- Rebase to 8.23.0 +- release number was bumped to synchronize rawhide + +- dropped rsyslog-8.12.0-gnutls-detection.patch + +- dropped rsyslog-8.8.0-immutable-json-props.patch + - patch was incorrect + - rebased with -> rsyslog-8.23.0-msg_c_nonoverwrite_merge.patch + +- removed unused files from git + +- added omamqp1 subpackage +- changed BuildRequires from json-c-devel to libfastjson-devel + + * Thu Feb 04 2016 Fedora Release Engineering - 8.12.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 0168483..22fdd70 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -c31c2d545c8a3b8695bdf076851d1517 rsyslog-8.12.0.tar.gz -8ec9d7a060450e92119bbf0dd28b624e rsyslog-doc-8.12.0.tar.gz +SHA512 (rsyslog-8.30.0.tar.gz) = 90e172d08ba7548252fc9744f71259dadf5a40afef405516e7b1601620913ca4b2ffc4859b16f369b9c1974ea10f4e41bc2d987e3d6bf9aabeb979f7de6aefe0 +SHA512 (rsyslog-doc-8.30.0.tar.gz) = 8068bb9bb8408447bff49730e9aac105eab1bd610592dd524e7639b668b2d05a4836d3a9862622445a0bb8d8b140db67c861dad6ec207d11049ac368e363684d