dovecot-2.2-pigeonhole: lib-sieve: Fixed problem in validator ex...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Wed Jul 30 11:50:58 UTC 2014
details: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/2e1350548161
changeset: 1900:2e1350548161
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Jul 30 13:50:12 2014 +0200
description:
lib-sieve: Fixed problem in validator extension handling.
The validate hook only worked for one extension.
diffstat:
src/lib-sieve/sieve-validator.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diffs (52 lines):
diff -r cd971c1c21e2 -r 2e1350548161 src/lib-sieve/sieve-validator.c
--- a/src/lib-sieve/sieve-validator.c Wed Jul 30 13:49:24 2014 +0200
+++ b/src/lib-sieve/sieve-validator.c Wed Jul 30 13:50:12 2014 +0200
@@ -1279,9 +1279,7 @@
}
}
- /* Skip block if result of test is const FALSEconst struct sieve_extension *sieve_validator_extension_load
-(struct sieve_validator *valdtr, struct sieve_command *cmd,
- struct sieve_ast_argument *ext_arg, string_t *ext_name) */
+ /* Skip block if result of test is const FALSE */
if ( result && *const_r == 0 )
return TRUE;
@@ -1351,13 +1349,11 @@
int const_value = -2;
next = sieve_ast_command_next(cmd_node);
- command_success = sieve_validate_command_context(valdtr, cmd_node);
- result = command_success && result;
/* Check if this is the first non-require command */
- if ( command_success && sieve_ast_node_type(block) == SAT_ROOT
- && !valdtr->finished_require && cmd_node->command != NULL
- && !sieve_command_is(cmd_node->command, cmd_require) ) {
+ if ( sieve_ast_node_type(block) == SAT_ROOT
+ && !valdtr->finished_require &&
+ strcasecmp(cmd_node->identifier, cmd_require.identifier) != 0 ) {
const struct sieve_validator_extension_reg *extrs;
unsigned int ext_count, i;
@@ -1370,13 +1366,17 @@
&& extrs[i].valext->validate != NULL ) {
if ( !extrs[i].valext->validate
- (extrs[i].ext, valdtr, extrs[i].context, extrs[i].arg) )
- fatal = TRUE;
- break;
+ (extrs[i].ext, valdtr, extrs[i].context, extrs[i].arg) ) {
+ fatal = TRUE;
+ break;
+ }
}
}
}
+ command_success = sieve_validate_command_context(valdtr, cmd_node);
+ result = command_success && result;
+
result = !fatal && sieve_validate_command(valdtr, cmd_node, &const_value)
&& result;
More information about the dovecot-cvs
mailing list