dovecot-2.2: imapc: Give an early error message if imapc_list_pr...

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 4 23:03:58 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/e9cab6d5e82a
changeset: 16175:e9cab6d5e82a
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 04 23:03:06 2013 +0300
description:
imapc: Give an early error message if imapc_list_prefix ends with separator.

diffstat:

 src/lib-storage/index/imapc/imapc-storage.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (24 lines):

diff -r 9891526c2def -r e9cab6d5e82a src/lib-storage/index/imapc/imapc-storage.c
--- a/src/lib-storage/index/imapc/imapc-storage.c	Thu Apr 04 22:49:38 2013 +0300
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Thu Apr 04 23:03:06 2013 +0300
@@ -186,6 +186,7 @@
 {
 	struct imapc_command *cmd;
 	struct imapc_simple_context sctx;
+	const char *imapc_list_prefix = storage->set->imapc_list_prefix;
 
 	imapc_simple_context_init(&sctx, storage);
 	cmd = imapc_client_cmd(storage->client, imapc_simple_callback, &sctx);
@@ -202,6 +203,12 @@
 		*error_r = "LIST didn't return hierarchy separator";
 		return -1;
 	}
+
+	if (imapc_list_prefix[0] != '\0' &&
+	    imapc_list_prefix[strlen(imapc_list_prefix)-1] == storage->list->sep) {
+		*error_r = "imapc_list_prefix must not end with hierarchy separator";
+		return -1;
+	}
 	return sctx.ret;
 }
 


More information about the dovecot-cvs mailing list