From 18e1267d96bf37a3737d38885304a2dc1365abde Mon Sep 17 00:00:00 2001 From: Milan Bartos Date: Tue, 31 Jul 2012 17:16:51 +0200 Subject: fix problem with cutting first 16 characters from message with bAnnotate on modified: plugins/imuxsock/imuxsock.c --- plugins/imuxsock/imuxsock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 76474724..2d9d4b5d 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -768,7 +768,11 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim fixPID(bufParseTAG, &i, cred); MsgSetTAG(pMsg, bufParseTAG, i); - MsgSetMSGoffs(pMsg, pMsg->iLenRawMsg - lenMsg); + if (pLstn->bAnnotate) { + MsgSetMSGoffs(pMsg, pMsg->iLenRawMsg - lenMsg - 16); + } else { + MsgSetMSGoffs(pMsg, pMsg->iLenRawMsg - lenMsg); + } if(pLstn->bParseHost) { pMsg->msgFlags = pLstn->flags | PARSE_HOSTNAME; -- cgit From 6ed28016ca1a98f183f72d1d381a5027949ca965 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 16 Oct 2012 15:01:16 +0200 Subject: bugfix: imuxsock truncated head of received message This happened only under some circumstances. Thanks to Marius Tomaschwesky, Florian Piekert and Milan Bartos for their help in solving this issue. Note that Milan sent a patch, which solved the problem under some conditions (can be found somewhat earlier in git history). However, it did not handle the original root cause, and so did not fix the problem always. The main reason was that the date parser modifies the provided lenghts. That part of the API was not properly used by the caller (who decremented the length once more). --- ChangeLog | 4 ++++ plugins/imuxsock/imuxsock.c | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9574a84f..1edcb71f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ --------------------------------------------------------------------------- Version 5.10.1 [V5-STABLE], 2012-0?-?? +- bugfix: imuxsock truncated head of received message + This happened only under some circumstances. Thanks to Marius + Tomaschwesky, Florian Piekert and Milan Bartos for their help in + solving this issue. - enable DNS resolution in imrelp Thanks to Apollon Oikonomopoulos for the patch - bugfix: invalid property name in property-filter could cause abort diff --git a/plugins/imuxsock/imuxsock.c b/plugins/imuxsock/imuxsock.c index 2d9d4b5d..cbb09b62 100644 --- a/plugins/imuxsock/imuxsock.c +++ b/plugins/imuxsock/imuxsock.c @@ -722,7 +722,7 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim CHKiRet(msgConstructWithTime(&pMsg, &st, tt)); MsgSetRawMsg(pMsg, (char*)pRcv, lenRcv); parser.SanitizeMsg(pMsg); - lenMsg = pMsg->iLenRawMsg - offs; + lenMsg = pMsg->iLenRawMsg - offs; /* SanitizeMsg() may have changed the size */ MsgSetInputName(pMsg, pInputName); MsgSetFlowControlType(pMsg, pLstn->flowCtl); @@ -752,7 +752,6 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim parse[15] = ' '; /* re-write \0 from fromatTimestamp3164 by SP */ /* update "counters" to reflect processed timestamp */ parse += 16; - lenMsg -= 16; } } @@ -767,12 +766,7 @@ SubmitMsg(uchar *pRcv, int lenRcv, lstn_t *pLstn, struct ucred *cred, struct tim if(pLstn->bWritePid) fixPID(bufParseTAG, &i, cred); MsgSetTAG(pMsg, bufParseTAG, i); - - if (pLstn->bAnnotate) { - MsgSetMSGoffs(pMsg, pMsg->iLenRawMsg - lenMsg - 16); - } else { - MsgSetMSGoffs(pMsg, pMsg->iLenRawMsg - lenMsg); - } + MsgSetMSGoffs(pMsg, pMsg->iLenRawMsg - lenMsg); if(pLstn->bParseHost) { pMsg->msgFlags = pLstn->flags | PARSE_HOSTNAME; -- cgit From a0c9fcfc77fb6b6bfa51a60760fd56a500f0083e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 16 Oct 2012 15:19:49 +0200 Subject: doc: fix minor small but important typo in ChangeLog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index db39911f..02555131 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ --------------------------------------------------------------------------- Version 6.4.3 [V6-STABLE] 2012-??-?? -- change lumberjack cookie to "@cee" from "@cee " +- change lumberjack cookie to "@cee:" from "@cee: " CEE originally specified the cookie with SP, whereas other lumberjack tools used it without space. In order to keep interop with lumberjack, we now use the cookie without space as well. I hope this can be changed -- cgit From 9cfb0aee7d7fa5304b44cbc35e005cc8189bb581 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 16 Oct 2012 15:45:21 +0200 Subject: prepare for version 7.1.11 --- ChangeLog | 8 ++++++-- configure.ac | 2 +- doc/manual.html | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9544bd8..7b73cf7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,12 @@ --------------------------------------------------------------------------- -Version 7.1.11 [beta] 2012-10-?? +Version 7.1.11 [beta] 2012-10-16 +- bugfix: imuxsock truncated head of received message + This happened only under some circumstances. Thanks to Marius + Tomaschwesky, Florian Piekert and Milan Bartos for their help in + solving this issue. - bugfix: do not crash if set statement is used with date field Thanks to Miloslav Trmač for the patch. -- change lumberjack cookie to "@cee" from "@cee " +- change lumberjack cookie to "@cee:" from "@cee: " CEE originally specified the cookie with SP, whereas other lumberjack tools used it without space. In order to keep interop with lumberjack, we now use the cookie without space as well. I hope this can be changed diff --git a/configure.ac b/configure.ac index f1ec4c0d..09217d09 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT([rsyslog],[7.1.10],[rsyslog@lists.adiscon.com]) +AC_INIT([rsyslog],[7.1.11],[rsyslog@lists.adiscon.com]) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) diff --git a/doc/manual.html b/doc/manual.html index 6fa3c012..cfad1a6a 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -19,7 +19,7 @@ rsyslog support available directly from the source!

Please visit the rsyslog sponsor's page to honor the project sponsors or become one yourself! We are very grateful for any help towards the project goals.

-

This documentation is for version 7.1.10 (beta branch) of rsyslog. +

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

If you like rsyslog, you might -- cgit From c86761d9124457c5ca380104ed7b99a524707298 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 16 Oct 2012 16:48:14 +0200 Subject: systemd: Drop obsolete compatibility flag In v6 [1], the compatibility mode has been removed and -c is a basically a no-op. So just drop that obsolete command line flag. [1] http://www.rsyslog.com/doc/v6compatibility.html --- rsyslog.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsyslog.service.in b/rsyslog.service.in index a5d53ad2..2265a491 100644 --- a/rsyslog.service.in +++ b/rsyslog.service.in @@ -3,7 +3,7 @@ Description=System Logging Service [Service] ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service -ExecStart=@sbindir@/rsyslogd -n -c6 +ExecStart=@sbindir@/rsyslogd -n Sockets=syslog.socket StandardOutput=null -- cgit From dfb08d5fcce46bace62a0d04308115c6ef9bb0a1 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 16 Oct 2012 16:52:11 +0200 Subject: systemd: Remove obsolete ExecStartPre command With the introduction of the journal in systemd v38 [1], the systemd-kmsg-syslogd.service service was removed. All major distributions which ship systemd use v44 or later in their current releases, so it seems safe to drop the ExecStartPre command. [1] http://lists.freedesktop.org/archives/systemd-devel/2012-January/004188.html --- rsyslog.service.in | 1 - 1 file changed, 1 deletion(-) diff --git a/rsyslog.service.in b/rsyslog.service.in index 2265a491..08a4870f 100644 --- a/rsyslog.service.in +++ b/rsyslog.service.in @@ -2,7 +2,6 @@ Description=System Logging Service [Service] -ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service ExecStart=@sbindir@/rsyslogd -n Sockets=syslog.socket StandardOutput=null -- cgit From c63fe7befc295ea0192d66e4e2014725c3d53e40 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 16 Oct 2012 18:27:44 +0200 Subject: doc: mention recent patches in ChangeLog --- ChangeLog | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b73cf7f..e497dfbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ - --------------------------------------------------------------------------- +---------------------------------------------------------------------------- +Version 7.1.12 [beta] 2012-10-?? +- minor updates to better support newer systemd developments + Thanks to Michael Biebl for the patches. +---------------------------------------------------------------------------- Version 7.1.11 [beta] 2012-10-16 - bugfix: imuxsock truncated head of received message This happened only under some circumstances. Thanks to Marius @@ -14,7 +18,7 @@ Version 7.1.11 [beta] 2012-10-16 Thanks to Miloslav Trmač for pointing this out and a similiar v7 patch. - added deprecated note to omruleset (plus clue to use "call") - added deprecated note to discard action (plus clue to use "stop") - --------------------------------------------------------------------------- +--------------------------------------------------------------------------- Version 7.1.10 [beta] 2012-10-11 - bugfix: m4 directory was not present in release tarball - bugfix: small memory leak with string-type templates @@ -22,7 +26,7 @@ Version 7.1.10 [beta] 2012-10-11 - bugfix: some config processing warning messages were treated as errors - bugfix: small memory leak when processing action() statements - bugfix: unknown action() parameters were not reported - --------------------------------------------------------------------------- +--------------------------------------------------------------------------- Version 7.1.9 [beta] 2012-10-09 - bugfix: comments inside objects (e.g. action()) were not properly handled - bugfix: in (non)equal comparisons the position of arrays influenced result -- cgit From bdc609639eae599d2c63bc0ba26a8c70ce718551 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 16 Oct 2012 18:58:11 +0200 Subject: cleanup: removed remains of -c option (compatibility mode) both from code & doc and emitted warning message if still used closes: http://bugzilla.adiscon.com/show_bug.cgi?id=361 Thanks to Michael Biebl for reporting & suggestions --- ChangeLog | 4 ++++ rsyslog.service.in | 2 +- tools/rsyslogd.8 | 28 ++++------------------------ tools/syslogd.c | 19 +++++-------------- 4 files changed, 14 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88d78c17..2690568c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ --------------------------------------------------------------------------- Version 6.4.3 [V6-STABLE] 2012-??-?? +- cleanup: removed remains of -c option (compatibility mode) + both from code & doc and emitted warning message if still used + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=361 + Thanks to Michael Biebl for reporting & suggestions - bugfix: imuxsock truncated head of received message This happened only under some circumstances. Thanks to Marius Tomaschwesky, Florian Piekert and Milan Bartos for their help in diff --git a/rsyslog.service.in b/rsyslog.service.in index a5d53ad2..2265a491 100644 --- a/rsyslog.service.in +++ b/rsyslog.service.in @@ -3,7 +3,7 @@ Description=System Logging Service [Service] ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service -ExecStart=@sbindir@/rsyslogd -n -c6 +ExecStart=@sbindir@/rsyslogd -n Sockets=syslog.socket StandardOutput=null diff --git a/tools/rsyslogd.8 b/tools/rsyslogd.8 index 6ac30e46..36f29769 100644 --- a/tools/rsyslogd.8 +++ b/tools/rsyslogd.8 @@ -1,7 +1,7 @@ .\" Copyright 2004-2008 Rainer Gerhards and Adiscon for the rsyslog modifications .\" May be distributed under the GNU General Public License .\" -.TH RSYSLOGD 8 "29 July 2008" "Version 3.21.1" "Linux System Administration" +.TH RSYSLOGD 8 "16 October 2012" "Version 6.4.3" "Linux System Administration" .SH NAME rsyslogd \- reliable and extended syslogd .SH SYNOPSIS @@ -93,9 +93,6 @@ the error element is ignored. It is tried to parse the rest of the line. .LP .SH OPTIONS -.B Note that in version 3 of rsyslog a number of command line options -.B have been deprecated and replaced with config file directives. The -.B -c option controls the backward compatibility mode in use. .TP .BI "\-A" When sending UDP messages, there are potentially multiple paths to @@ -123,26 +120,9 @@ If neither -4 nor -6 is given, listens to all configured addresses of the system. .TP .BI "\-c " "version" -Selects the desired backward compatibility mode. It must always be the -first option on the command line, as it influences processing of the -other options. To use the rsyslog v3 native interface, specify -c3. To -use compatibility mode , either do not use -c at all or use --c where -.IR version -is the rsyslog version that it shall be -compatible with. Using -c0 tells rsyslog to be command-line compatible -to sysklogd, which is the default if -c is not given. -.B Please note that rsyslogd issues warning messages if the -c3 -.B command line option is not given. -This is to alert you that your are running in compatibility -mode. Compatibility mode interferes with your rsyslog.conf commands and -may cause some undesired side-effects. It is meant to be used with a -plain old rsyslog.conf - if you use new features, things become -messy. So the best advice is to work through this document, convert -your options and config file and then use rsyslog in native mode. In -order to aid you in this process, rsyslog logs every -compatibility-mode config file directive it has generated. So you can -simply copy them from your logfile and paste them to the config. +This option has been obsolted and has no function any longer. It is still +accepted in order not to break existing scripts. However, future versions +may not support it. .TP .B "\-d" Turns on debug mode. Using this the daemon will not proceed a diff --git a/tools/syslogd.c b/tools/syslogd.c index 5064511d..b158feb3 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -220,11 +220,6 @@ struct queuefilenames_s { uchar *name; } *queuefilenames = NULL; -/* global variables for config file state */ -int iCompatibilityMode = 0; /* version we should be compatible with; 0 means sysklogd. It is - the default, so if no -c option is given, we make ourselvs - as compatible to sysklogd as possible. */ -/* end global config file state variables */ int MarkInterval = 20 * 60; /* interval between marks in seconds - read-only after startup */ int send_to_all = 0; /* send message to all IPv4/IPv6 addresses */ @@ -250,10 +245,9 @@ static void sighup_handler(); static int usage(void) { - fprintf(stderr, "usage: rsyslogd [-c] [-46AdnqQvwx] [-l] [-s]\n" + fprintf(stderr, "usage: rsyslogd [-46AdnqQvwx] [-l] [-s]\n" " [-f] [-i] [-N] [-M]\n" " [-u]\n" - "To run rsyslogd in native mode, use \"rsyslogd -c5 \"\n\n" "For further information see http://www.rsyslog.com/doc\n"); exit(1); /* "good" exit - done to terminate usage() */ } @@ -1862,10 +1856,7 @@ int realMain(int argc, char **argv) * split of functionality, this is no longer a problem. Thanks to varmofekoj for * suggesting this algo. * Note: where we just need to set some flags and can do so without knowledge - * of other options, we do this during the inital option processing. With later - * versions (if a dependency on -c option is introduced), we must move that code - * to other places, but I think it is quite appropriate and saves code to do this - * only when actually neeeded. + * of other options, we do this during the inital option processing. * rgerhards, 2008-04-04 */ while((ch = getopt(argc, argv, "46a:Ac:def:g:hi:l:m:M:nN:op:qQr::s:t:T:u:vwx")) != EOF) { @@ -1896,7 +1887,7 @@ int realMain(int argc, char **argv) CHKiRet(bufOptAdd(ch, optarg)); break; case 'c': /* compatibility mode */ - iCompatibilityMode = atoi(optarg); + fprintf(stderr, "rsyslogd: error: option -c is no longer supported - ignored"); break; case 'd': /* debug - must be handled now, so that debug is active during init! */ debugging_on = 1; @@ -1920,8 +1911,8 @@ int realMain(int argc, char **argv) if(argc - optind) usage(); - DBGPRINTF("rsyslogd %s startup, compatibility mode %d, module path '%s', cwd:%s\n", - VERSION, iCompatibilityMode, glblModPath == NULL ? "" : (char*)glblModPath, + DBGPRINTF("rsyslogd %s startup, module path '%s', cwd:%s\n", + VERSION, glblModPath == NULL ? "" : (char*)glblModPath, getcwd(cwdbuf, sizeof(cwdbuf))); /* we are done with the initial option parsing and processing. Now we init the system. */ -- cgit