summaryrefslogtreecommitdiffstats
path: root/runtime/cfsysline.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/cfsysline.c')
-rw-r--r--runtime/cfsysline.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c
index ad087652..fdbb8f2a 100644
--- a/runtime/cfsysline.c
+++ b/runtime/cfsysline.c
@@ -37,6 +37,7 @@
#include "cfsysline.h"
#include "obj.h"
+#include "conf.h"
#include "errmsg.h"
#include "srUtils.h"
#include "unicode-helper.h"
@@ -560,7 +561,8 @@ finalize_it:
* time (TODO). -- rgerhards, 2008-02-14
*/
static rsRetVal
-doSyslogName(uchar **pp, rsRetVal (*pSetHdlr)(void*, int), void *pVal, syslogName_t *pNameTable)
+doSyslogName(uchar **pp, rsRetVal (*pSetHdlr)(void*, int),
+ void *pVal, syslogName_t *pNameTable)
{
DEFiRet;
cstr_t *pStrB;
@@ -602,6 +604,15 @@ doFacility(uchar **pp, rsRetVal (*pSetHdlr)(void*, int), void *pVal)
}
+static rsRetVal
+doGoneAway(__attribute__((unused)) uchar **pp,
+ __attribute__((unused)) rsRetVal (*pSetHdlr)(void*, int),
+ __attribute__((unused)) void *pVal)
+{
+ errmsg.LogError(0, RS_RET_CMD_GONE_AWAY, "config directive is no longer supported -- ignored");
+ return RS_RET_CMD_GONE_AWAY;
+}
+
/* Implements the severity syntax.
* rgerhards, 2008-02-14
*/
@@ -731,6 +742,9 @@ static rsRetVal cslchCallHdlr(cslCmdHdlr_t *pThis, uchar **ppConfLine)
case eCmdHdlrGetWord:
pHdlr = doGetWord;
break;
+ case eCmdHdlrGoneAway:
+ pHdlr = doGoneAway;
+ break;
default:
iRet = RS_RET_NOT_IMPLEMENTED;
goto finalize_it;
@@ -823,8 +837,7 @@ finalize_it:
* caller does not need to take care of that. The caller must, however,
* free pCmdName if he allocated it dynamically! -- rgerhards, 2007-08-09
*/
-rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData,
- void *pOwnerCookie)
+rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie)
{
DEFiRet;
cslCmd_t *pThis;
@@ -929,11 +942,13 @@ rsRetVal processCfSysLineCommand(uchar *pCmdName, uchar **p)
uchar *pHdlrP; /* the handler's private p (else we could only call one handler) */
int bWasOnceOK; /* was the result of an handler at least once RS_RET_OK? */
uchar *pOKp = NULL; /* returned conf line pointer when it was OK */
+ int bHadScopingErr = 0; /* set if a scoping error occured */
iRet = llFind(&llCmdList, (void *) pCmdName, (void*) &pCmd);
if(iRet == RS_RET_NOT_FOUND) {
- errmsg.LogError(0, RS_RET_NOT_FOUND, "invalid or yet-unknown config file command - have you forgotten to load a module?");
+ errmsg.LogError(0, RS_RET_NOT_FOUND, "invalid or yet-unknown config file command '%s' - "
+ "have you forgotten to load a module?", pCmdName);
}
if(iRet != RS_RET_OK)
@@ -946,7 +961,7 @@ rsRetVal processCfSysLineCommand(uchar *pCmdName, uchar **p)
* reason is that handlers are independent. An error in one
* handler does not necessarily mean that another one will
* fail, too. Later, we might add a config variable to control
- * this behaviour (but I am not sure if that is rally
+ * this behaviour (but I am not sure if that is really
* necessary). -- rgerhards, 2007-07-31
*/
pHdlrP = *p;
@@ -964,6 +979,10 @@ rsRetVal processCfSysLineCommand(uchar *pCmdName, uchar **p)
if(iRetLL != RS_RET_END_OF_LINKEDLIST)
iRet = iRetLL;
+ if(bHadScopingErr) {
+ iRet = RS_RET_CONF_INVLD_SCOPE;
+ }
+
finalize_it:
RETiRet;
}