Skip to content
Snippets Groups Projects
Commit 0b5e7b1a authored by Stephan Bosch's avatar Stephan Bosch
Browse files

lib-sieve: sieve-result - Fix panic occurring upon temp fail after committed...

lib-sieve: sieve-result - Fix panic occurring upon temp fail after committed keep-equivalent action.

The determination of whether a keep-equivalent action was already executed is
performed in sieve_result_implicit_keep_execute(), which can also be called from
sieve_result_implicit_keep_finalize(). But there, the keep-equivalent status was
checked before any call to sieve_result_implicit_keep_execute(), which would
thus yield the wrong result.

This change also makes the associated debug message more specific (otherwise two
identical debug messages are logged) and an assert is added that makes sure the
keep-equivalent action is actually finalized when the implicit keep was supposed
to be finalized.

Panic was:

Panic: file sieve-result.c: line 1706 (sieve_result_implicit_keep_finalize): assertion failed: (aexec_keep->state == SIEVE_ACTION_EXECUTION_STATE_EXECUTED)
parent d1c44652
No related branches found
No related tags found
No related merge requests found
......@@ -1662,15 +1662,6 @@ sieve_result_implicit_keep_finalize(struct sieve_result_execution *rexec)
break;
}
if (rexec->keep_equiv_action != NULL) {
struct sieve_action_execution *ke_aexec =
rexec->keep_equiv_action;
e_debug(rexec->event, "No implicit keep needed "
"(equivalent %s action already executed)",
sieve_action_name(&ke_aexec->action->action));
return ke_aexec->status;
}
if ((eenv->flags & SIEVE_EXECUTE_FLAG_DEFER_KEEP) != 0) {
e_debug(rexec->event, "Execution of implicit keep is deferred");
return rexec->keep_status;
......@@ -1700,6 +1691,19 @@ sieve_result_implicit_keep_finalize(struct sieve_result_execution *rexec)
if (act_keep->def == NULL)
return rexec->keep_status;
if (rexec->keep_equiv_action != NULL) {
struct sieve_action_execution *ke_aexec =
rexec->keep_equiv_action;
i_assert(ke_aexec->state >=
SIEVE_ACTION_EXECUTION_STATE_FINALIZED);
e_debug(rexec->event, "No implicit keep needed "
"(equivalent %s action already finalized)",
sieve_action_name(&ke_aexec->action->action));
return ke_aexec->status;
}
e_debug(rexec->event, "Finalize implicit keep (status=%s)",
sieve_execution_exitcode_to_str(rexec->status));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.