From 610cce4a79e20d1ae524f4b732e3e19ae67bde7a Mon Sep 17 00:00:00 2001 From: Tomas Heinrich Date: Mon, 23 Jan 2012 16:52:57 +0100 Subject: [PATCH] rsyslog upgrade - upgrade to new upstream version 5.8.7 - change license from 'GPLv3+' to '(GPLv3+ and ASL 2.0)' http://blog.gerhards.net/2012/01/rsyslog-licensing-update.html - use a specific version for obsoleting sysklogd - add patches for better sysklogd compatibility (taken from upstream) --- .gitignore | 1 + ...log-5.8.7-sysklogd-compat-1-template.patch | 34 ++++++++++++ rsyslog-5.8.7-sysklogd-compat-2-option.patch | 53 +++++++++++++++++++ rsyslog.spec | 19 +++++-- sources | 2 +- 5 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 rsyslog-5.8.7-sysklogd-compat-1-template.patch create mode 100644 rsyslog-5.8.7-sysklogd-compat-2-option.patch diff --git a/.gitignore b/.gitignore index 3e9d488..6a085af 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ rsyslog-4.6.3.tar.gz /rsyslog-5.8.2.tar.gz /rsyslog-5.8.5.tar.gz /rsyslog-5.8.6.tar.gz +/rsyslog-5.8.7.tar.gz diff --git a/rsyslog-5.8.7-sysklogd-compat-1-template.patch b/rsyslog-5.8.7-sysklogd-compat-1-template.patch new file mode 100644 index 0000000..604dce6 --- /dev/null +++ b/rsyslog-5.8.7-sysklogd-compat-1-template.patch @@ -0,0 +1,34 @@ +diff -up rsyslog-5.8.7/doc/rsyslog_conf_templates.html.orig rsyslog-5.8.7/doc/rsyslog_conf_templates.html +--- rsyslog-5.8.7/doc/rsyslog_conf_templates.html.orig 2012-01-20 14:04:54.976086070 +0100 ++++ rsyslog-5.8.7/doc/rsyslog_conf_templates.html 2012-01-20 14:06:35.890817529 +0100 +@@ -146,6 +146,10 @@ with high-precision timestamps and timez + useful if you send messages to other syslogd's or rsyslogd + below + version 3.12.5. ++
  • RSYSLOG_SysklogdFileFormat ++- sysklogd compatible log file format. If used with options: $SpaceLFOnReceive on; ++$EscapeControlCharactersOnReceive off; $DropTrailingLFOnReception off, ++the log format will conform to sysklogd log format.
  • +
  • RSYSLOG_ForwardFormat + - a new high-precision forwarding format very similar to the + traditional one, but with high-precision timestamps and timezone +diff -up rsyslog-5.8.7/tools/syslogd.c.orig rsyslog-5.8.7/tools/syslogd.c +--- rsyslog-5.8.7/tools/syslogd.c.orig 2012-01-20 14:05:04.985960243 +0100 ++++ rsyslog-5.8.7/tools/syslogd.c 2012-01-20 14:11:20.527239529 +0100 +@@ -335,6 +335,7 @@ static uchar template_StdUsrMsgFmt[] = " + static uchar template_StdDBFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')\",SQL"; + static uchar template_StdPgSQLFmt[] = "\"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-pgsql%', '%timegenerated:::date-pgsql%', %iut%, '%syslogtag%')\",STDSQL"; + static uchar template_spoofadr[] = "\"%fromhost-ip%\""; ++static uchar template_SysklogdFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n\""; + /* end templates */ + + +@@ -2171,6 +2172,8 @@ static rsRetVal mainThread() + tplAddLine(" StdUsrMsgFmt", &pTmp); + pTmp = template_StdDBFmt; + tplAddLine(" StdDBFmt", &pTmp); ++ pTmp = template_SysklogdFileFormat; ++ tplAddLine("RSYSLOG_SysklogdFileFormat", &pTmp); + pTmp = template_StdPgSQLFmt; + tplAddLine(" StdPgSQLFmt", &pTmp); + pTmp = template_spoofadr; diff --git a/rsyslog-5.8.7-sysklogd-compat-2-option.patch b/rsyslog-5.8.7-sysklogd-compat-2-option.patch new file mode 100644 index 0000000..e3c6bf8 --- /dev/null +++ b/rsyslog-5.8.7-sysklogd-compat-2-option.patch @@ -0,0 +1,53 @@ +diff -up rsyslog-5.8.7/doc/rsyslog_conf_global.html.orig rsyslog-5.8.7/doc/rsyslog_conf_global.html +--- rsyslog-5.8.7/doc/rsyslog_conf_global.html.orig 2012-01-20 14:17:43.565424577 +0100 ++++ rsyslog-5.8.7/doc/rsyslog_conf_global.html 2012-01-20 14:36:41.208123930 +0100 +@@ -143,6 +143,7 @@ our paper on $Escape8BitCharactersOnReceive
  • +
  • $EscapeControlCharactersOnReceive
  • +
  • $EscapeControlCharactersOnReceive [on|off] - escape USASCII HT character
  • ++
  • $SpaceLFOnReceive [on/off] - instructs rsyslogd to replace LF with spaces during message reception (sysklogd compatibility aid)
  • +
  • $ErrorMessagesToStderr [on|off] - direct rsyslogd error message to stderr (in addition to other targets)
  • +
  • $FailOnChownFailure
  • +
  • $FileCreateMode
  • +diff -up rsyslog-5.8.7/runtime/parser.c.orig rsyslog-5.8.7/runtime/parser.c +--- rsyslog-5.8.7/runtime/parser.c.orig 2012-01-20 14:17:55.421275542 +0100 ++++ rsyslog-5.8.7/runtime/parser.c 2012-01-20 15:04:00.664515268 +0100 +@@ -60,6 +60,7 @@ DEFobjCurrIf(ruleset) + /* config data */ + static uchar cCCEscapeChar = '#';/* character to be used to start an escape sequence for control chars */ + static int bEscapeCCOnRcv = 1; /* escape control characters on reception: 0 - no, 1 - yes */ ++static int bSpaceLFOnRcv = 0; /* replace newlines with spaces on reception: 0 - no, 1 - yes */ + static int bEscape8BitChars = 0; /* escape characters > 127 on reception: 0 - no, 1 - yes */ + static int bEscapeTab = 1; /* escape tab control character when doing CC escapes: 0 - no, 1 - yes */ + static int bDropTrailingLF = 1; /* drop trailing LF's on reception? */ +@@ -354,9 +355,13 @@ SanitizeMsg(msg_t *pMsg) + int bNeedSanitize = 0; + for(iSrc = 0 ; iSrc < lenMsg ; iSrc++) { + if(iscntrl(pszMsg[iSrc])) { ++ if(bSpaceLFOnRcv && pszMsg[iSrc] == '\n') ++ pszMsg[iSrc] = ' '; ++ else + if(pszMsg[iSrc] == '\0' || bEscapeCCOnRcv) { + bNeedSanitize = 1; +- break; ++ if (!bSpaceLFOnRcv) ++ break; + } + } else if(pszMsg[iSrc] > 127 && bEscape8BitChars) { + bNeedSanitize = 1; +@@ -645,6 +650,7 @@ resetConfigVariables(uchar __attribute__ + { + cCCEscapeChar = '#'; + bEscapeCCOnRcv = 1; /* default is to escape control characters */ ++ bSpaceLFOnRcv = 0; + bEscape8BitChars = 0; /* default is to escape control characters */ + bEscapeTab = 1; /* default is to escape control characters */ + bDropTrailingLF = 1; /* default is to drop trailing LF's on reception */ +@@ -698,6 +704,7 @@ BEGINObjClassInit(parser, 1, OBJ_IS_CORE + CHKiRet(regCfSysLineHdlr((uchar *)"controlcharacterescapeprefix", 0, eCmdHdlrGetChar, NULL, &cCCEscapeChar, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"droptrailinglfonreception", 0, eCmdHdlrBinary, NULL, &bDropTrailingLF, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"escapecontrolcharactersonreceive", 0, eCmdHdlrBinary, NULL, &bEscapeCCOnRcv, NULL)); ++ CHKiRet(regCfSysLineHdlr((uchar *)"spacelfonreceive", 0, eCmdHdlrBinary, NULL, &bSpaceLFOnRcv, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"escape8bitcharactersonreceive", 0, eCmdHdlrBinary, NULL, &bEscape8BitChars, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"escapecontrolcharactertab", 0, eCmdHdlrBinary, NULL, &bEscapeTab, NULL)); + CHKiRet(regCfSysLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, NULL)); diff --git a/rsyslog.spec b/rsyslog.spec index 9d2ec8e..15aedc0 100644 --- a/rsyslog.spec +++ b/rsyslog.spec @@ -5,9 +5,9 @@ Summary: Enhanced system logging and kernel message trapping daemon Name: rsyslog -Version: 5.8.6 -Release: 2%{?dist} -License: GPLv3+ +Version: 5.8.7 +Release: 1%{?dist} +License: (GPLv3+ and ASL 2.0) Group: System Environment/Daemons URL: http://www.rsyslog.com/ Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz @@ -17,6 +17,8 @@ Source3: rsyslog.sysconfig Source4: rsyslog.log # tweak the upstream service file to honour configuration from /etc/sysconfig/rsyslog Patch0: rsyslog-5.8.5-systemd.patch +Patch1: rsyslog-5.8.7-sysklogd-compat-1-template.patch +Patch2: rsyslog-5.8.7-sysklogd-compat-2-option.patch BuildRequires: zlib-devel BuildRequires: systemd-units >= 18 @@ -30,7 +32,7 @@ Requires(preun): systemd-units >= 20 Requires(postun): /sbin/service Requires(postun): systemd-units >= 20 Provides: syslog -Obsoletes: sysklogd +Obsoletes: sysklogd < 1.5-11 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %package sysvinit @@ -139,6 +141,8 @@ of source ports. %prep %setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %ifarch sparc64 @@ -312,6 +316,13 @@ mv /var/lock/subsys/rsyslogd /var/lock/subsys/rsyslog %{_libdir}/rsyslog/omudpspoof.so %changelog +* Mon Jan 23 2012 Tomas Heinrich 5.8.7-1 +- upgrade to new upstream version 5.8.7 +- change license from 'GPLv3+' to '(GPLv3+ and ASL 2.0)' + http://blog.gerhards.net/2012/01/rsyslog-licensing-update.html +- use a specific version for obsoleting sysklogd +- add patches for better sysklogd compatibility (taken from upstream) + * Sat Jan 14 2012 Fedora Release Engineering - 5.8.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild diff --git a/sources b/sources index 6ec3da7..0fa6de8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c46db0496066b82faf735bd4222208d7 rsyslog-5.8.6.tar.gz +d806a91de534d6e33d7d1c1138cfdd37 rsyslog-5.8.7.tar.gz