dovecot-sieve-1.0: If sieve path is a directory instead of a fil...

dovecot at dovecot.org dovecot at dovecot.org
Fri May 16 16:10:56 EEST 2008


details:   http://hg.dovecot.org/dovecot-sieve-1.0/rev/055ed27d8950
changeset: 34:055ed27d8950
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 16 16:10:53 2008 +0300
description:
If sieve path is a directory instead of a file, give a clear error message
instead of "input in flex scanner failed".

diffstat:

1 file changed, 4 insertions(+)
src/sieve-cmu.c |    4 ++++

diffs (14 lines):

diff -r 5c3ba11994cb -r 055ed27d8950 src/sieve-cmu.c
--- a/src/sieve-cmu.c	Fri Apr 25 02:54:13 2008 +0300
+++ b/src/sieve-cmu.c	Fri May 16 16:10:53 2008 +0300
@@ -588,6 +588,10 @@ dovecot_sieve_compile(sieve_interp_t *in
 		i_error("stat(%s) failed: %m", script_path);
 		return -1;
 	}
+	if (S_ISDIR(st.st_mode)) {
+		i_error("%s should be a file, not a directory", script_path);
+		return -1;
+	}
 	if (stat(compiled_path, &st2) < 0) {
 		if (errno != ENOENT) {
 			i_error("stat(%s) failed: %m", script_path);


More information about the dovecot-cvs mailing list