dovecot-2.1-pigeonhole: sievec tool: fixed segfault bug and anot...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Tue Apr 24 20:33:23 EEST 2012


details:   http://hg.rename-it.nl/dovecot-2.1-pigeonhole/rev/93bfa75d9ab9
changeset: 1616:93bfa75d9ab9
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Tue Apr 24 19:33:19 2012 +0200
description:
sievec tool: fixed segfault bug and another bug making it omit actually saving the binary.

diffstat:

 src/lib-sieve/sieve-binary-file.c |  2 +-
 src/lib-sieve/sieve-script-file.c |  6 +++---
 src/lib-sieve/sieve.c             |  3 +++
 3 files changed, 7 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r ef5045159e6b -r 93bfa75d9ab9 src/lib-sieve/sieve-binary-file.c
--- a/src/lib-sieve/sieve-binary-file.c	Tue Apr 24 13:08:36 2012 +0200
+++ b/src/lib-sieve/sieve-binary-file.c	Tue Apr 24 19:33:19 2012 +0200
@@ -284,7 +284,7 @@
 		if ( sbin->svinst->debug ) {
 			sieve_sys_debug(sbin->svinst, "binary save: not saving binary %s, "
 				"because it is already stored", path);
-		}		
+		}
 		return 0;
 	}
 
diff -r ef5045159e6b -r 93bfa75d9ab9 src/lib-sieve/sieve-script-file.c
--- a/src/lib-sieve/sieve-script-file.c	Tue Apr 24 13:08:36 2012 +0200
+++ b/src/lib-sieve/sieve-script-file.c	Tue Apr 24 19:33:19 2012 +0200
@@ -219,7 +219,7 @@
 		if ( success ) {
 			if ( _script->bin_dir != NULL ) {
 				binpath = sieve_binfile_from_name(name);
-				binpath =	t_strconcat(_script->bin_dir, "/", binpath, NULL);
+				binpath = t_strconcat(_script->bin_dir, "/", binpath, NULL);
 			} else {
 				binpath = sieve_binfile_from_name(basename);
 				if ( *dirpath != '\0' )
@@ -232,7 +232,7 @@
 			script->filename = p_strdup(pool, filename);
 			script->dirpath = p_strdup(pool, dirpath);
 			script->binpath = p_strdup(pool, binpath);
-			
+
 			if ( script->script.name == NULL ||
 				strcmp(script->script.name, basename) == 0 )
 				script->script.location = script->path;
@@ -345,7 +345,7 @@
 {
 	struct sieve_file_script *script = (struct sieve_file_script *)_script;
 
-	if ( sieve_script_setup_bindir(_script, 0700) < 0 )
+	if ( _script->bin_dir != NULL && sieve_script_setup_bindir(_script, 0700) < 0 )
 		return -1;
 
 	return sieve_binary_save(sbin, script->binpath, update,
diff -r ef5045159e6b -r 93bfa75d9ab9 src/lib-sieve/sieve.c
--- a/src/lib-sieve/sieve.c	Tue Apr 24 13:08:36 2012 +0200
+++ b/src/lib-sieve/sieve.c	Tue Apr 24 19:33:19 2012 +0200
@@ -406,6 +406,9 @@
 (struct sieve_binary *sbin, const char *bin_path, bool update,
 	mode_t save_mode, enum sieve_error *error_r)
 {
+	if  ( bin_path == NULL )
+		return sieve_save(sbin, update, error_r);
+
 	return sieve_binary_save(sbin, bin_path, update, save_mode, error_r);
 }
 


More information about the dovecot-cvs mailing list