From 19464b9f2b32fc053d3f52ec1e9da1a19bad74b7 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 28 Jun 2013 12:43:26 +0200 Subject: [io]mrelp: improve error reporting --- plugins/omrelp/omrelp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins/omrelp/omrelp.c') diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index a3dac025..bc27b402 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -130,6 +130,15 @@ static uchar *getRelpPt(instanceData *pData) return(pData->port); } +static void +onErr(void *pUsr, char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) +{ + instanceData *pData = (instanceData*) pUsr; + errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "omrelp[%s:%s]: error '%s', object " + " '%s' - action may not work as intended", + pData->target, pData->port, errmesg, objinfo); +} + static void onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) { @@ -512,6 +521,7 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(relpEngineConstruct(&pRelpEngine)); CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf)); CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr)); + CHKiRet(relpEngineSetOnErr(pRelpEngine, onErr)); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); /* tell which objects we need */ -- cgit v1.2.3