diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-21 09:26:34 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-21 09:26:34 +0200 |
commit | 16450df18b3f72160aa232d2fb6e0b064f9ff55d (patch) | |
tree | 93fb2f1f58a9a9333860e5ca739cd30e8e5b9574 /plugins/omrelp/omrelp.c | |
parent | af464bde4a4649dc51a5ee3c6a70346d1eba173d (diff) | |
download | rsyslog-16450df18b3f72160aa232d2fb6e0b064f9ff55d.tar.gz rsyslog-16450df18b3f72160aa232d2fb6e0b064f9ff55d.tar.bz2 rsyslog-16450df18b3f72160aa232d2fb6e0b064f9ff55d.zip |
omrelp: emit error message on peer authentication failure
Diffstat (limited to 'plugins/omrelp/omrelp.c')
-rw-r--r-- | plugins/omrelp/omrelp.c | 12 |
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 */ |