dovecot-1.2: lib-storage: Disallow control characters in mailbox...

dovecot at dovecot.org dovecot at dovecot.org
Fri Aug 7 21:21:48 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/e57d5c9daed3
changeset: 9289:e57d5c9daed3
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Aug 07 14:21:40 2009 -0400
description:
lib-storage: Disallow control characters in mailbox names when creating them.

diffstat:

1 file changed, 7 insertions(+)
src/lib-storage/mailbox-list.c |    7 +++++++

diffs (18 lines):

diff -r c00df1152f1f -r e57d5c9daed3 src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Fri Aug 07 13:56:04 2009 -0400
+++ b/src/lib-storage/mailbox-list.c	Fri Aug 07 14:21:40 2009 -0400
@@ -446,7 +446,14 @@ bool mailbox_list_is_valid_create_name(s
 bool mailbox_list_is_valid_create_name(struct mailbox_list *list,
 				       const char *name)
 {
+	const char *p;
 	int ret;
+
+	/* safer to just disallow all control characters */
+	for (p = name; *p != '\0'; p++) {
+		if (*p < ' ')
+			return FALSE;
+	}
 
 	T_BEGIN {
 		string_t *str = t_str_new(256);


More information about the dovecot-cvs mailing list