[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dovecot-cvs
Subject:    dovecot-2.2: imap: If any FETCH/STORE tries to access modseqs wh...
From:       dovecot () dovecot ! org (dovecot at dovecot ! org)
Date:       2013-12-19 19:37:51
Message-ID: hg.bd50cc9fa757.1387481871.6920021320469856403 () localhost ! localdomain
[Download RAW message or body]

details:   http://hg.dovecot.org/dovecot-2.2/rev/bd50cc9fa757
changeset: 17074:bd50cc9fa757
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Dec 19 21:37:28 2013 +0200
description:
imap: If any FETCH/STORE tries to access modseqs when NOMODSEQ was returned, return BAD.

diffstat:

 src/imap/cmd-fetch.c  |  5 +++++
 src/imap/cmd-store.c  |  5 +++++
 src/imap/imap-fetch.c |  4 ++++
 3 files changed, 14 insertions(+), 0 deletions(-)

diffs (44 lines):

diff -r 1d8fef81d4b6 -r bd50cc9fa757 src/imap/cmd-fetch.c
--- a/src/imap/cmd-fetch.c	Thu Dec 19 21:31:57 2013 +0200
+++ b/src/imap/cmd-fetch.c	Thu Dec 19 21:37:28 2013 +0200
@@ -111,6 +111,11 @@
 	uint64_t modseq;
 
 	if (strcmp(name, "CHANGEDSINCE") == 0) {
+		if (cmd->client->nonpermanent_modseqs) {
+			client_send_command_error(cmd,
+				"FETCH CHANGEDSINCE can't be used with non-permanent modseqs");
+			return FALSE;
+		}
 		if (!imap_arg_get_atom(*args, &str) ||
 		    str_to_uint64(str, &modseq) < 0) {
 			client_send_command_error(cmd,
diff -r 1d8fef81d4b6 -r bd50cc9fa757 src/imap/cmd-store.c
--- a/src/imap/cmd-store.c	Thu Dec 19 21:31:57 2013 +0200
+++ b/src/imap/cmd-store.c	Thu Dec 19 21:37:28 2013 +0200
@@ -57,6 +57,11 @@
 		}
 
 		if (strcasecmp(name, "UNCHANGEDSINCE") == 0) {
+			if (ctx->cmd->client->nonpermanent_modseqs) {
+				client_send_command_error(ctx->cmd,
+					"STORE UNCHANGEDSINCE can't be used with non-permanent modseqs");
+				return FALSE;
+			}
 			if (str_to_uint64(value, &ctx->max_modseq) < 0) {
 				client_send_command_error(ctx->cmd,
 							  "Invalid modseq");
diff -r 1d8fef81d4b6 -r bd50cc9fa757 src/imap/imap-fetch.c
--- a/src/imap/imap-fetch.c	Thu Dec 19 21:31:57 2013 +0200
+++ b/src/imap/imap-fetch.c	Thu Dec 19 21:37:28 2013 +0200
@@ -804,6 +804,10 @@
 
 bool imap_fetch_modseq_init(struct imap_fetch_init_context *ctx)
 {
+	if (ctx->fetch_ctx->client->nonpermanent_modseqs) {
+		ctx->error = "FETCH MODSEQ can't be used with non-permanent modseqs";
+		return FALSE;
+	}
 	(void)client_enable(ctx->fetch_ctx->client, MAILBOX_FEATURE_CONDSTORE);
 	imap_fetch_add_handler(ctx, IMAP_FETCH_HANDLER_FLAG_BUFFERED,
 			       NULL, fetch_modseq, NULL);

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic