dovecot-2.2-pigeonhole: lib-sieve: increase action instance coun...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Fri Aug 10 00:01:49 EEST 2012


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/9d962388f5f6
changeset: 1649:9d962388f5f6
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Tue Aug 07 00:36:11 2012 +0200
description:
lib-sieve: increase action instance count (for limit checking) only when an action is actually created.

diffstat:

 src/lib-sieve/sieve-result.c |  34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diffs (48 lines):

diff -r 837c108f0363 -r 9d962388f5f6 src/lib-sieve/sieve-result.c
--- a/src/lib-sieve/sieve-result.c	Tue Aug 07 00:34:12 2012 +0200
+++ b/src/lib-sieve/sieve-result.c	Tue Aug 07 00:36:11 2012 +0200
@@ -553,27 +553,27 @@
 		raction = raction->next;
 	}
 
-	/* Check policy limit on total number of actions */
-	if ( svinst->max_actions > 0 && result->action_count >= svinst->max_actions )
-		{
-		sieve_runtime_error(renv, action.location,
-			"total number of actions exceeds policy limit (%u > %u)",
-			result->action_count+1, svinst->max_actions);
-		return -1;
-	}
-
-	/* Check policy limit on number of this class of actions */
-	if ( instance_limit > 0 && instance_count >= instance_limit ) {
-		sieve_runtime_error(renv, action.location,
-			"number of %s actions exceeds policy limit (%u > %u)",
-			act_def->name, instance_count+1, instance_limit);
-		return -1;
-	}
-
 	if ( kaction != NULL ) {
 		/* Use existing keep action to define new one */
 		raction = kaction;
 	} else {
+		/* Check policy limit on total number of actions */
+		if ( svinst->max_actions > 0 && result->action_count >= svinst->max_actions )
+		{
+			sieve_runtime_error(renv, action.location,
+				"total number of actions exceeds policy limit (%u > %u)",
+				result->action_count+1, svinst->max_actions);
+			return -1;
+		}
+
+		/* Check policy limit on number of this class of actions */
+		if ( instance_limit > 0 && instance_count >= instance_limit ) {
+			sieve_runtime_error(renv, action.location,
+				"number of %s actions exceeds policy limit (%u > %u)",
+				act_def->name, instance_count+1, instance_limit);
+			return -1;
+		}
+
 		/* Create new action object */
 		raction = p_new(result->pool, struct sieve_result_action, 1);
 		raction->action.executed = FALSE;


More information about the dovecot-cvs mailing list