dovecot-2.2: Merged changes from v2.1 tree.

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 20 21:45:49 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/f874733b4029
changeset: 16080:f874733b4029
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 20 21:44:48 2013 +0200
description:
Merged changes from v2.1 tree.

diffstat:

 src/doveadm/doveadm-pw.c                      |   2 +-
 src/lib-mail/message-decoder.c                |  14 +++++++++++---
 src/lib-settings/settings-parser.c            |  11 ++++++++++-
 src/lib-storage/index/dbox-common/dbox-save.c |  12 ++++++++----
 src/lib-storage/mail-storage-settings.c       |   2 +-
 src/plugins/fts/fts-api.c                     |   7 ++++++-
 6 files changed, 37 insertions(+), 11 deletions(-)

diffs (134 lines):

diff -r 9a913c803608 -r f874733b4029 src/doveadm/doveadm-pw.c
--- a/src/doveadm/doveadm-pw.c	Wed Mar 20 21:04:29 2013 +0200
+++ b/src/doveadm/doveadm-pw.c	Wed Mar 20 21:44:48 2013 +0200
@@ -78,7 +78,7 @@
 	if (rounds > 0)
 		password_set_encryption_rounds(rounds);
 
-	if (test_hash != NULL)
+	if (test_hash != NULL && plaintext == NULL)
 		plaintext = t_askpass("Enter password to verify: ");
 	while (plaintext == NULL) {
 		const char *check;
diff -r 9a913c803608 -r f874733b4029 src/lib-mail/message-decoder.c
--- a/src/lib-mail/message-decoder.c	Wed Mar 20 21:04:29 2013 +0200
+++ b/src/lib-mail/message-decoder.c	Wed Mar 20 21:44:48 2013 +0200
@@ -201,7 +201,7 @@
 {
 	unsigned char trans_buf[MAX_TRANSLATION_BUF_SIZE+1];
 	unsigned int data_wanted, skip;
-	size_t trans_size;
+	size_t trans_size, orig_size;
 
 	/* @UNSAFE: move the previously untranslated bytes to trans_buf
 	   and see if we have now enough data to get the next character
@@ -212,11 +212,19 @@
 		data_wanted = *size;
 	memcpy(trans_buf + ctx->translation_size, *data, data_wanted);
 
-	trans_size = ctx->translation_size + data_wanted;
+	orig_size = trans_size = ctx->translation_size + data_wanted;
 	(void)charset_to_utf8(ctx->charset_trans, trans_buf,
 			      &trans_size, ctx->buf2);
 
-	i_assert(trans_size > ctx->translation_size);
+	if (trans_size <= ctx->translation_size) {
+		/* need more data to finish the translation. */
+		i_assert(orig_size < MAX_TRANSLATION_BUF_SIZE);
+		memcpy(ctx->translation_buf, trans_buf, orig_size);
+		ctx->translation_size = orig_size;
+		*data += *size;
+		*size = 0;
+		return;
+	}
 	skip = trans_size - ctx->translation_size;
 
 	i_assert(*size >= skip);
diff -r 9a913c803608 -r f874733b4029 src/lib-settings/settings-parser.c
--- a/src/lib-settings/settings-parser.c	Wed Mar 20 21:04:29 2013 +0200
+++ b/src/lib-settings/settings-parser.c	Wed Mar 20 21:44:48 2013 +0200
@@ -959,8 +959,15 @@
 		if (input->stream_errno != 0) {
 			ctx->error = p_strdup_printf(ctx->parser_pool,
 						     "read() failed: %m");
+		} else if (input->v_offset == 0) {
+			ctx->error = p_strdup_printf(ctx->parser_pool,
+				"read(%s) disconnected before receiving any data",
+				i_stream_get_name(input));
 		} else {
-			ctx->error = "input is missing end-of-settings line";
+			ctx->error = p_strdup_printf(ctx->parser_pool,
+				"read(%s) disconnected before receiving "
+				"end-of-settings line",
+				i_stream_get_name(input));
 		}
 		break;
 	case -2:
@@ -991,6 +998,7 @@
 	}
 
 	input = i_stream_create_fd(fd, max_line_length, TRUE);
+	i_stream_set_name(input, path);
 	ret = settings_parse_stream_read(ctx, input);
 	i_stream_unref(&input);
 
@@ -1080,6 +1088,7 @@
 	i_close_fd(&fd[1]);
 
 	input = i_stream_create_fd(fd[0], (size_t)-1, TRUE);
+	i_stream_set_name(input, bin_path);
 	ret = settings_parse_stream_read(ctx, input);
 	i_stream_destroy(&input);
 
diff -r 9a913c803608 -r f874733b4029 src/lib-storage/index/dbox-common/dbox-save.c
--- a/src/lib-storage/index/dbox-common/dbox-save.c	Wed Mar 20 21:04:29 2013 +0200
+++ b/src/lib-storage/index/dbox-common/dbox-save.c	Wed Mar 20 21:44:48 2013 +0200
@@ -113,10 +113,14 @@
 		ctx->failed = TRUE;
 	}
 	if (mdata->output != dbox_output) {
-		/* e.g. zlib plugin had changed this */
-		o_stream_ref(dbox_output);
-		o_stream_destroy(&mdata->output);
-		mdata->output = dbox_output;
+		if (mdata->output != NULL) {
+			/* e.g. zlib plugin had changed this */
+			o_stream_ref(dbox_output);
+			o_stream_destroy(&mdata->output);
+			mdata->output = dbox_output;
+		} else {
+			i_assert(ctx->failed);
+		}
 	}
 	index_mail_cache_parse_deinit(ctx->ctx.dest_mail,
 				      ctx->ctx.data.received_date,
diff -r 9a913c803608 -r f874733b4029 src/lib-storage/mail-storage-settings.c
--- a/src/lib-storage/mail-storage-settings.c	Wed Mar 20 21:04:29 2013 +0200
+++ b/src/lib-storage/mail-storage-settings.c	Wed Mar 20 21:44:48 2013 +0200
@@ -458,7 +458,7 @@
 		return FALSE;
 	}
 
-	if (ns->alias_for != NULL) {
+	if (ns->alias_for != NULL && !ns->disabled) {
 		if (array_is_created(&ns->user_set->namespaces)) {
 			namespaces = array_get(&ns->user_set->namespaces,
 					       &count);
diff -r 9a913c803608 -r f874733b4029 src/plugins/fts/fts-api.c
--- a/src/plugins/fts/fts-api.c	Wed Mar 20 21:04:29 2013 +0200
+++ b/src/plugins/fts/fts-api.c	Wed Mar 20 21:44:48 2013 +0200
@@ -342,8 +342,13 @@
 	result->box_results = p_new(result->pool, struct fts_result, i+1);
 
 	for (i = 0; boxes[i] != NULL; i++) {
+		struct fts_result *box_result = &result->box_results[i];
+
+		p_array_init(&box_result->definite_uids, result->pool, 32);
+		p_array_init(&box_result->maybe_uids, result->pool, 32);
+		p_array_init(&box_result->scores, result->pool, 32);
 		if (backend->v.lookup(backend, boxes[i], args,
-				      and_args, &result->box_results[i]) < 0)
+				      and_args, box_result) < 0)
 			return -1;
 	}
 	return 0;


More information about the dovecot-cvs mailing list