Disable RUN in callbacks to ordx and subst_xxx functions.

This commit is contained in:
Dianne Skoll
2025-08-15 20:27:51 -04:00
parent 5cb0e82be2
commit 7b7b861399
11 changed files with 147 additions and 22 deletions

View File

@@ -640,13 +640,15 @@ static int CalculateNextTimeUsingSched(QueuedRem *q)
return NO_TIME;
}
RunDisabled = q->RunDisabled; /* Don't want weird scheduling functions
to be a security hole! */
while(1) {
char exprBuf[VAR_NAME_LEN+32];
snprintf(exprBuf, sizeof(exprBuf), "%s(%d)", q->sched, q->ntrig);
s = exprBuf;
r = EvalExpr(&s, &v, NULL);
if (q->RunDisabled) {
r = EvalExprRunDisabled(&s, &v, NULL);
} else {
r = EvalExpr(&s, &v, NULL);
}
if (r) {
q->sched[0] = 0;
return NO_TIME;