diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/netstrm.c | 2 | ||||
-rw-r--r-- | runtime/netstrm.h | 5 | ||||
-rw-r--r-- | runtime/nsd.h | 5 | ||||
-rw-r--r-- | runtime/nsd_gtls.c | 7 | ||||
-rw-r--r-- | runtime/nsd_ptcp.c | 6 | ||||
-rw-r--r-- | runtime/rsconf.c | 18 |
6 files changed, 33 insertions, 10 deletions
diff --git a/runtime/netstrm.c b/runtime/netstrm.c index a6f840a5..49ba8f35 100644 --- a/runtime/netstrm.c +++ b/runtime/netstrm.c @@ -250,7 +250,7 @@ EnableKeepAlive(netstrm_t *pThis) /* check connection - slim wrapper for NSD driver function */ -static void +static rsRetVal CheckConnection(netstrm_t *pThis) { ISOBJ_TYPE_assert(pThis, netstrm); diff --git a/runtime/netstrm.h b/runtime/netstrm.h index f6931104..ee8d9e59 100644 --- a/runtime/netstrm.h +++ b/runtime/netstrm.h @@ -53,7 +53,7 @@ BEGINinterface(netstrm) /* name must also be changed in ENDinterface macro! */ rsRetVal (*SetDrvrMode)(netstrm_t *pThis, int iMode); rsRetVal (*SetDrvrAuthMode)(netstrm_t *pThis, uchar*); rsRetVal (*SetDrvrPermPeers)(netstrm_t *pThis, permittedPeers_t*); - void (*CheckConnection)(netstrm_t *pThis); /* This is a trick mostly for plain tcp syslog */ + rsRetVal (*CheckConnection)(netstrm_t *pThis); /* This is a trick mostly for plain tcp syslog */ /* the GetSock() below is a hack to make imgssapi work. In the long term, * we should migrate imgssapi to a stream driver, which will relieve us of * this problem. Please note that nobody else should use GetSock(). Using it @@ -72,9 +72,10 @@ BEGINinterface(netstrm) /* name must also be changed in ENDinterface macro! */ /* v4 */ rsRetVal (*EnableKeepAlive)(netstrm_t *pThis); ENDinterface(netstrm) -#define netstrmCURR_IF_VERSION 4 /* increment whenever you change the interface structure! */ +#define netstrmCURR_IF_VERSION 5 /* increment whenever you change the interface structure! */ /* interface version 3 added GetRemAddr() * interface version 4 added EnableKeepAlive() -- rgerhards, 2009-06-02 + * interface version 5 changed return of CheckConnection from void to rsRetVal -- alorbach, 2012-09-06 * */ /* prototypes */ diff --git a/runtime/nsd.h b/runtime/nsd.h index ab64c443..d7d6abbd 100644 --- a/runtime/nsd.h +++ b/runtime/nsd.h @@ -63,7 +63,7 @@ BEGINinterface(nsd) /* name must also be changed in ENDinterface macro! */ rsRetVal (*SetMode)(nsd_t *pThis, int mode); /* sets a driver specific mode - see driver doc for details */ rsRetVal (*SetAuthMode)(nsd_t *pThis, uchar*); /* sets a driver specific mode - see driver doc for details */ rsRetVal (*SetPermPeers)(nsd_t *pThis, permittedPeers_t*); /* sets driver permitted peers for auth needs */ - void (*CheckConnection)(nsd_t *pThis); /* This is a trick mostly for plain tcp syslog */ + rsRetVal (*CheckConnection)(nsd_t *pThis); /* This is a trick mostly for plain tcp syslog */ rsRetVal (*GetSock)(nsd_t *pThis, int *pSock); rsRetVal (*SetSock)(nsd_t *pThis, int sock); /* GetSock() and SetSock() return an error if the driver does not use plain @@ -80,9 +80,10 @@ BEGINinterface(nsd) /* name must also be changed in ENDinterface macro! */ /* v5 */ rsRetVal (*EnableKeepAlive)(nsd_t *pThis); ENDinterface(nsd) -#define nsdCURR_IF_VERSION 5 /* increment whenever you change the interface structure! */ +#define nsdCURR_IF_VERSION 6 /* increment whenever you change the interface structure! */ /* interface version 4 added GetRemAddr() * interface version 5 added EnableKeepAlive() -- rgerhards, 2009-06-02 + * interface version 6 changed return of CheckConnection from void to rsRetVal -- alorbach, 2012-09-06 */ /* interface for the select call */ diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index c2db9c94..71eafbd2 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -1316,13 +1316,16 @@ finalize_it: * This is a dummy here. For details, check function common in ptcp driver. * rgerhards, 2008-06-09 */ -static void +static rsRetVal CheckConnection(nsd_t __attribute__((unused)) *pNsd) { + DEFiRet; nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd; ISOBJ_TYPE_assert(pThis, nsd_gtls); - nsd_ptcp.CheckConnection(pThis->pTcp); + CHKiRet(nsd_ptcp.CheckConnection(pThis->pTcp)); +finalize_it: + RETiRet; } diff --git a/runtime/nsd_ptcp.c b/runtime/nsd_ptcp.c index a174899c..12f891ea 100644 --- a/runtime/nsd_ptcp.c +++ b/runtime/nsd_ptcp.c @@ -694,9 +694,10 @@ finalize_it: * http://blog.gerhards.net/2008/06/getting-bit-more-reliability-from-plain.html * rgerhards, 2008-06-09 */ -static void +static rsRetVal CheckConnection(nsd_t *pNsd) { + DEFiRet; int rc; char msgbuf[1]; /* dummy */ nsd_ptcp_t *pThis = (nsd_ptcp_t*) pNsd; @@ -709,7 +710,10 @@ CheckConnection(nsd_t *pNsd) * need to close our side, too. */ sockClose(&pThis->sock); + ABORT_FINALIZE(RS_RET_IO_ERROR); } +finalize_it: + RETiRet; } diff --git a/runtime/rsconf.c b/runtime/rsconf.c index 5d2407ec..032d01a3 100644 --- a/runtime/rsconf.c +++ b/runtime/rsconf.c @@ -248,6 +248,7 @@ cnfDoActlst(struct cnfactlst *actlst, rule_t *pRule) struct cnfcfsyslinelst *cflst; action_t *pAction; uchar *str; + rsRetVal localRet; DEFiRet; while(actlst != NULL) { @@ -261,9 +262,22 @@ cnfDoActlst(struct cnfactlst *actlst, rule_t *pRule) "around line %d", actlst->cnfFile, actlst->lineno); } } else { - dbgprintf("legacy action line:%s\n", actlst->data.legActLine); + DBGPRINTF("legacy action line:%s\n", actlst->data.legActLine); str = (uchar*) actlst->data.legActLine; - CHKiRet(cflineDoAction(loadConf, &str, &pAction)); + if((localRet = cflineDoAction(loadConf, &str, &pAction)) != RS_RET_OK) { + uchar szErrLoc[MAXFNAME + 64]; + if(localRet != RS_RET_OK_WARN) { + DBGPRINTF("legacy action line NOT successfully processed\n"); + } + snprintf((char*)szErrLoc, sizeof(szErrLoc) / sizeof(uchar), + "%s, line %d", actlst->cnfFile, actlst->lineno); + errmsg.LogError(0, NO_ERRCODE, "the last %s occured in %s:\"%s\"", + (localRet == RS_RET_OK_WARN) ? "warning" : "error", + (char*)szErrLoc, (char*)actlst->data.legActLine); + if(localRet != RS_RET_OK_WARN) { + ABORT_FINALIZE(localRet); + } + } iRet = llAppend(&(pRule)->llActList, NULL, (void*) pAction); } for( cflst = actlst->syslines |