From 1e20ff6b71aa19ca45ae7e68421370c830141af2 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 6 Nov 2013 11:50:27 +0100 Subject: enforce that actions can no longer "do something" on action creation This doesn't play well with config load/priv drop and was not strictly enforced in v7. --- action.c | 12 +++--------- action.h | 2 +- runtime/conf.c | 5 ++--- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/action.c b/action.c index 718d9038..bae4e589 100644 --- a/action.c +++ b/action.c @@ -1456,7 +1456,7 @@ actionApplyCnfParam(action_t *pAction, struct cnfparamvals *pvals) rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringRequest_t *pOMSR, struct cnfparamvals *actParams, - struct nvlst *lst, int bSuspended) + struct nvlst *lst) { DEFiRet; int i; @@ -1544,14 +1544,9 @@ addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, pAction->pMod = pMod; pAction->pModData = pModData; -// TODO #warning we need to look at the following - // Probably the core init needs to be done during createWrkrInstance() - //if(bSuspended) - // actionSuspend(pAction, pWti); - CHKiRet(actionConstructFinalize(pAction, lst)); - /* TODO: if we exit here, we have a memory leak... */ + /* TODO: if we exit here, we have a (quite acceptable...) memory leak */ *ppAction = pAction; /* finally store the action pointer */ @@ -1638,8 +1633,7 @@ actionNewInst(struct nvlst *lst, action_t **ppAction) FINALIZE; /* iRet is already set to error state */ } - if((iRet = addAction(&pAction, pMod, pModData, pOMSR, paramvals, lst, - (iRet == RS_RET_SUSPENDED)? 1 : 0)) == RS_RET_OK) { + if((iRet = addAction(&pAction, pMod, pModData, pOMSR, paramvals, lst)) == RS_RET_OK) { /* check if the module is compatible with select features * (currently no such features exist) */ loadConf->actions.nbrActions++; /* one more active action! */ diff --git a/action.h b/action.h index 666542ac..bcb85859 100644 --- a/action.h +++ b/action.h @@ -87,7 +87,7 @@ rsRetVal actionDoAction(action_t *pAction); rsRetVal actionWriteToAction(action_t *pAction, msg_t *pMsg, wti_t*); rsRetVal actionCallHUPHdlr(action_t *pAction); rsRetVal actionClassInit(void); -rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringRequest_t *pOMSR, struct cnfparamvals *actParams, struct nvlst *lst, int bSuspended); +rsRetVal addAction(action_t **ppAction, modInfo_t *pMod, void *pModData, omodStringRequest_t *pOMSR, struct cnfparamvals *actParams, struct nvlst *lst); rsRetVal activateActions(void); rsRetVal actionNewInst(struct nvlst *lst, action_t **ppAction); rsRetVal actionProcessCnf(struct cnfobj *o); diff --git a/runtime/conf.c b/runtime/conf.c index 1544e364..83931bca 100644 --- a/runtime/conf.c +++ b/runtime/conf.c @@ -518,9 +518,8 @@ rsRetVal cflineDoAction(rsconf_t *conf, uchar **p, action_t **ppAction) bHadWarning = 1; iRet = RS_RET_OK; } - if(iRet == RS_RET_OK || iRet == RS_RET_SUSPENDED) { - if((iRet = addAction(&pAction, pMod, pModData, pOMSR, NULL, NULL, - (iRet == RS_RET_SUSPENDED)? 1 : 0)) == RS_RET_OK) { + if(iRet == RS_RET_OK) { + if((iRet = addAction(&pAction, pMod, pModData, pOMSR, NULL, NULL)) == RS_RET_OK) { /* here check if the module is compatible with select features * (currently, we have no such features!) */ conf->actions.nbrActions++; /* one more active action! */ -- cgit v1.2.3