Hi,

I'm going to use im3195, because Fortinet decided to implement RFC 3195 and (accidentally?) force its usage in fips-cc mode of their latest FIPS 140-2 validated firmware.

So here is a patch to get it working again.

Regards,
Martin Körper
diff -rupN rsyslog-7.2.1_orig/plugins/im3195/im3195.c rsyslog-7.2.1/plugins/im3195/im3195.c
--- rsyslog-7.2.1_orig/plugins/im3195/im3195.c	2012-10-22 12:44:43.000000000 +0200
+++ rsyslog-7.2.1/plugins/im3195/im3195.c	2012-11-29 17:00:58.005247732 +0100
@@ -48,6 +48,7 @@
 #include "cfsysline.h"
 #include "msg.h"
 #include "errmsg.h"
+#include "unicode-helper.h"
 
 MODULE_TYPE_INPUT
 MODULE_TYPE_NOKEEP
@@ -56,6 +57,7 @@ MODULE_CNFNAME("im3195")
 /* Module static data */
 DEF_IMOD_STATIC_DATA
 DEFobjCurrIf(errmsg)
+DEFobjCurrIf(prop)
 
 /* configuration settings */
 
@@ -71,6 +73,8 @@ static int listenPort = 601;
  */
 static srAPIObj* pAPI;
 
+static prop_t *pInputName = NULL;       /* there is only one global inputName for all messages generated by this module */
+
 
 /* This method is called when a message has been fully received.
  * It passes the received message to the rsyslog main message
@@ -90,7 +94,7 @@ void OnReceive(srAPIObj __attribute__((u
 	srSLMGGetRawMSG(pSLMG, &pszRawMsg);
 
 	parseAndSubmitMessage(fromHost, fromHostIP, pszRawMsg, strlen((char*)pszRawMsg),
-		PARSE_HOSTNAME, eFLOWCTL_FULL_DELAY, (uchar*)"im3195", NULL, 0, NULL);
+		PARSE_HOSTNAME, eFLOWCTL_FULL_DELAY, pInputName, NULL, 0, NULL);
 }
 
 
@@ -171,6 +175,9 @@ ENDafterRun
 BEGINmodExit
 CODESTARTmodExit
 	srAPIExitLib(pAPI); /* terminate liblogging */
+	/* global variable cleanup */
+	if(pInputName != NULL)
+		prop.Destruct(&pInputName);
 	/* release objects we used */
 	objRelease(errmsg, CORE_COMPONENT);
 ENDmodExit
@@ -193,9 +200,15 @@ CODESTARTmodInit
 	*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
 CODEmodInit_QueryRegCFSLineHdlr
 	CHKiRet(objUse(errmsg, CORE_COMPONENT));
+	CHKiRet(objUse(prop, CORE_COMPONENT));
 
 	CHKiRet(omsdRegCFSLineHdlr((uchar *)"input3195listenport", 0, eCmdHdlrInt, NULL, &listenPort, STD_LOADABLE_MODULE_ID));
 	CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID));
+
+	CHKiRet(prop.Construct(&pInputName));
+	CHKiRet(prop.SetString(pInputName, UCHAR_CONSTANT("im3195"), sizeof("im3195") - 1));
+	CHKiRet(prop.ConstructFinalize(pInputName));
+
 ENDmodInit
 /* vim:set ai:
  */
_______________________________________________
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