diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-20 17:41:16 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-20 17:41:16 +0200 |
commit | fdc34dc5710e2766aba63cb2f5c5e8ba1ab3f4f3 (patch) | |
tree | 77795a48742b1240d94b8acb16841553a596d31e /plugins/imrelp/imrelp.c | |
parent | 8dd7f6e50e24d6f8f0fb0c30dc0be73086405846 (diff) | |
download | rsyslog-fdc34dc5710e2766aba63cb2f5c5e8ba1ab3f4f3.tar.gz rsyslog-fdc34dc5710e2766aba63cb2f5c5e8ba1ab3f4f3.tar.bz2 rsyslog-fdc34dc5710e2766aba63cb2f5c5e8ba1ab3f4f3.zip |
imrelp: emit error message on authentication error
Diffstat (limited to 'plugins/imrelp/imrelp.c')
-rw-r--r-- | plugins/imrelp/imrelp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index 9d131ba0..fe12ebf1 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -145,6 +145,14 @@ static struct cnfparamblk inppblk = /* ------------------------------ callbacks ------------------------------ */ +static void +onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) +{ + instanceConf_t *inst = (instanceConf_t*) pUsr; + errmsg.LogError(0, NO_ERRCODE, "imrelp[%s]: authentication error '%s', peer " + "is '%s'", inst->pszBindPort, errmesg, authinfo); +} + /* callback for receiving syslog messages. This function is invoked from the * RELP engine when a syslog message arrived. It must return a relpRetVal, * with anything else but RELP_RET_OK terminating the relp session. Please note @@ -264,6 +272,7 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) CHKiRet(relpEngineSetFamily(pRelpEngine, glbl.GetDefPFFamily())); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); CHKiRet(relpEngineSetSyslogRcv2(pRelpEngine, onSyslogRcv)); + CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr)); if (!glbl.GetDisableDNS()) { CHKiRet(relpEngineSetDnsLookupMode(pRelpEngine, 1)); } |