Package: rsyslog
Version: 5.8.11-1
Severity: normal
Tags: patch

Hi,

when using RELP for remote logging, the server does not resolve the client's
hostname using the fromhost property and the property contains the client's IP
address instead. This is not the case when using udp or tcp logging, where
hostnames are resolved as expected. Although librelp has hostname resolution
functionality built-in, it seems that rsyslog does not explicitly enable
hostname resolution during the initialization of the RELP engine. The attached
patch fixes this, while honouring the global DNS resolution status ("-x"
command line flag).

Thanks,
Apollon

P.S.: This problem and the fix also apply to squeeze's version.

-- System Information:
Debian Release: 6.0.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (90, 'unstable'), (80, 
'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-0.bpo.2-amd64 (SMP w/8 CPU cores)
Locale: LANG=el_GR.UTF-8, LC_CTYPE=el_GR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages rsyslog depends on:
ii  libc6                   2.11.3-3         Embedded GNU C Library: Shared lib
ii  lsb-base                3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii  zlib1g                  1:1.2.3.4.dfsg-3 compression library - runtime

Versions of packages rsyslog recommends:
ii  logrotate                     3.7.8-6    Log rotation utility

Versions of packages rsyslog suggests:
ii  rsyslog-doc                   5.8.11-1~bpo+2    documentation for rsyslog
pn  rsyslog-gnutls                <none>     (no description available)
pn  rsyslog-gssapi                <none>     (no description available)
pn  rsyslog-mysql | rsyslog-pgsql <none>     (no description available)
ii  rsyslog-relp                  5.8.11-1~bpo+2     (no description available)

-- no debconf information
--- a/plugins/imrelp/imrelp.c
+++ b/plugins/imrelp/imrelp.c
@@ -44,6 +44,7 @@
 #include "msg.h"
 #include "unicode-helper.h"
 #include "prop.h"
+#include "glbl.h"
 
 MODULE_TYPE_INPUT
 MODULE_TYPE_NOKEEP
@@ -52,6 +53,7 @@
 DEF_IMOD_STATIC_DATA
 DEFobjCurrIf(net)
 DEFobjCurrIf(prop)
+DEFobjCurrIf(glbl)
 
 /* Module static data */
 static relpEngine_t *pRelpEngine;	/* our relp engine */
@@ -104,6 +106,9 @@
 		CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf));
 		CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required));
 		CHKiRet(relpEngineSetSyslogRcv(pRelpEngine, onSyslogRcv));
+		if (!glbl.GetDisableDNS()) {
+			CHKiRet(relpEngineSetDnsLookupMode(pRelpEngine, 1));
+		}
 	}
 
 	CHKiRet(relpEngineAddListner(pRelpEngine, pNewVal));
@@ -162,6 +167,7 @@
 		iRet = relpEngineDestruct(&pRelpEngine);
 
 	/* release objects we used */
+	objRelease(glbl, CORE_COMPONENT);
 	objRelease(prop, CORE_COMPONENT);
 	objRelease(net, LM_NET_FILENAME);
 ENDmodExit
@@ -187,6 +193,7 @@
 CODEmodInit_QueryRegCFSLineHdlr
 	pRelpEngine = NULL;
 	/* request objects we use */
+	CHKiRet(objUse(glbl, CORE_COMPONENT));
 	CHKiRet(objUse(prop, CORE_COMPONENT));
 	CHKiRet(objUse(net, LM_NET_FILENAME));
 

Reply via email to