Hi,

there are several bugs in the imuxsock module:


* Two legacy configuration directives have no effect

Variables for $SystemLogUseSysTimeStamp and $SystemLogUsePIDFromSystem are not copied from cs to loadModConf in endCnfLoad(). Patch attached.


* UseSysTimeStamp doesn't work correctly

It works correctly only if certain initializations dependent on bUseCreds are carried out, but bUseCreds is computed from couple of other options not including bUseSysTimeStamp.

By a stroke of luck, it works with the default settings as SysSock.IgnoreOwnMessages, on which bUseCreds depends, is implicitly on.

No patch here, but the formula for bUseCreds [1] should probably be modified.


* There's no SysSock.* counterpart to CreatePath.

This might actually be intended, not sure.


Tomas

[1] listeners[0].bUseCreds = (runModConf->bWritePidSysSock || runModConf->ratelimitIntervalSysSock || runModConf->bAnnotateSysSock || runModConf->bDiscardOwnMsgs) ? 1 : 0;
>From 471b93d9b59a71f95d5218f59ca0ea4f385b5039 Mon Sep 17 00:00:00 2001
From: Tomas Heinrich <[email protected]>
Date: Wed, 6 Nov 2013 17:57:49 +0100
Subject: [PATCH] imuxsock: pass along missing legacy config variables

Not doing so caused that the system log socket was unaffected by these
directives.

bCreatePath is still not passed but currently, there's no placeholder for it.
---
 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 c503852..1c4ba47 100644
--- a/plugins/imuxsock/imuxsock.c
+++ b/plugins/imuxsock/imuxsock.c
@@ -159,11 +159,11 @@ static int startIndexUxLocalSockets; /* process fd from that index on (used to
 static int nfd = 1; /* number of Unix sockets open / read-only after startup */
 static int sd_fds = 0;			/* number of systemd activated sockets */
 
-/* config vars for legacy config system */
 #define DFLT_bCreatePath 0
 #define DFLT_ratelimitInterval 0
 #define DFLT_ratelimitBurst 200
 #define DFLT_ratelimitSeverity 1			/* do not rate-limit emergency messages */
+/* config vars for the legacy config system */
 static struct configSettings_s {
 	int bOmitLocalLogging;
 	uchar *pLogSockName;
@@ -188,6 +188,7 @@ static struct configSettings_s {
 	int bParseTrusted;		/* parse trusted properties */
 } cs;
 
+/* config vars for the v2 config system (rsyslog v6+) */
 struct instanceConf_s {
 	uchar *sockName;
 	uchar *pLogHostName;		/* host name to use with this socket */
@@ -1256,11 +1257,14 @@ BEGINendCnfLoad
 CODESTARTendCnfLoad
 	if(!loadModConf->configSetViaV2Method) {
 		/* persist module-specific settings from legacy config system */
+		/* these are used to initialize the system log socket (listeners[0]) */
 		loadModConf->bOmitLocalLogging = cs.bOmitLocalLogging;
 		loadModConf->pLogSockName = cs.pLogSockName;
 		loadModConf->bIgnoreTimestamp = cs.bIgnoreTimestampSysSock;
+		loadModConf->bUseSysTimeStamp = cs.bUseSysTimeStampSysSock;
 		loadModConf->bUseFlowCtl = cs.bUseFlowCtlSysSock;
 		loadModConf->bAnnotateSysSock = cs.bAnnotateSysSock;
+		loadModConf->bWritePidSysSock = cs.bWritePidSysSock;
 		loadModConf->bParseTrusted = cs.bParseTrusted;
 		loadModConf->ratelimitIntervalSysSock = cs.ratelimitIntervalSysSock;
 		loadModConf->ratelimitBurstSysSock = cs.ratelimitBurstSysSock;
-- 
1.7.10.4

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to