dovecot: If client tries to use unknown list-extended options, f...

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 25 15:47:40 EET 2007


details:   http://hg.dovecot.org/dovecot/rev/a249d916f6e6
changeset: 6856:a249d916f6e6
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 25 15:05:31 2007 +0200
description:
If client tries to use unknown list-extended options, fail with BAD.

diffstat:

1 file changed, 9 insertions(+), 5 deletions(-)
src/imap/cmd-list.c |   14 +++++++++-----

diffs (32 lines):

diff -r 5c514ebda66a -r a249d916f6e6 src/imap/cmd-list.c
--- a/src/imap/cmd-list.c	Sun Nov 25 03:15:07 2007 +0200
+++ b/src/imap/cmd-list.c	Sun Nov 25 15:05:31 2007 +0200
@@ -108,10 +108,13 @@ parse_select_flags(struct cmd_list_conte
 				MAILBOX_LIST_ITER_RETURN_SUBSCRIBED;
 		} else if (strcasecmp(atom, "RECURSIVEMATCH") == 0)
 			list_flags |= MAILBOX_LIST_ITER_SELECT_RECURSIVEMATCH;
-		else {
+		else if (strcasecmp(atom, "REMOTE") == 0) {
+			/* not supported, ignore */
+		} else {
 			/* skip also optional list value */
-			if (args[1].type == IMAP_ARG_LIST)
-				args++;
+			client_send_command_error(ctx->cmd,
+						  "Unknown select options");
+			return FALSE;
 		}
 		args++;
 	}
@@ -156,8 +159,9 @@ parse_return_flags(struct cmd_list_conte
 			args++;
 		} else {
 			/* skip also optional list value */
-			if (args[1].type == IMAP_ARG_LIST)
-				args++;
+			client_send_command_error(ctx->cmd,
+						  "Unknown return options");
+			return FALSE;
 		}
 		args++;
 	}


More information about the dovecot-cvs mailing list