]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: If any FETCH/STORE tries to access modseqs when NOMODSEQ was returned, return...
authorTimo Sirainen <tss@iki.fi>
Thu, 19 Dec 2013 19:37:28 +0000 (21:37 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 19 Dec 2013 19:37:28 +0000 (21:37 +0200)
src/imap/cmd-fetch.c
src/imap/cmd-store.c
src/imap/imap-fetch.c

index 36cf2a6f4ec51ea21b88142d7d626d643473b3ae..dc1b9039b6b22b1ccf2ec7f262e364d75cc055ca 100644 (file)
@@ -111,6 +111,11 @@ fetch_parse_modifier(struct imap_fetch_context *ctx,
        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,
index 7a187e475c2bb3edb29bb2b562534330d8eb3f83..d5f713aaac0d4b66e156f9daf2b9a30e481c9512 100644 (file)
@@ -57,6 +57,11 @@ store_parse_modifiers(struct imap_store_context *ctx,
                }
 
                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");
index c2796f6cfc84e02eb3a3a6e78f0c4a3580d835d9..1470a54e04806b7ac09b316e7176c4e4a7b89f05 100644 (file)
@@ -804,6 +804,10 @@ static int fetch_modseq(struct imap_fetch_context *ctx, struct mail *mail,
 
 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);