summaryrefslogtreecommitdiffstats
path: root/plugins/omrelp/omrelp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/omrelp/omrelp.c')
-rw-r--r--plugins/omrelp/omrelp.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index 31a30921..0534396a 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -127,6 +127,14 @@ static uchar *getRelpPt(instanceData *pData)
return(pData->port);
}
+static void
+onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode)
+{
+ instanceData *pData = (instanceData*) pUsr;
+ errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "omrelp[%s]: authentication error '%s', peer "
+ "is '%s'", pData->port, errmesg, authinfo);
+}
+
static inline rsRetVal
doCreateRelpClient(instanceData *pData)
{
@@ -136,6 +144,8 @@ doCreateRelpClient(instanceData *pData)
ABORT_FINALIZE(RS_RET_RELP_ERR);
if(relpCltSetTimeout(pData->pRelpClt, pData->timeout) != RELP_RET_OK)
ABORT_FINALIZE(RS_RET_RELP_ERR);
+ if(relpCltSetUsrPtr(pData->pRelpClt, pData) != RELP_RET_OK)
+ ABORT_FINALIZE(RS_RET_RELP_ERR);
if(pData->bEnableTLS) {
if(relpCltEnableTLS(pData->pRelpClt) != RELP_RET_OK)
ABORT_FINALIZE(RS_RET_RELP_ERR);
@@ -166,7 +176,6 @@ finalize_it:
RETiRet;
}
-
BEGINcreateInstance
CODESTARTcreateInstance
pData->timeout = 90;
@@ -481,6 +490,7 @@ CODEmodInit_QueryRegCFSLineHdlr
/* create our relp engine */
CHKiRet(relpEngineConstruct(&pRelpEngine));
CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf));
+ CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr));
CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required));
/* tell which objects we need */