]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Log and hide invalid entries in subscriptions file.
authorTimo Sirainen <tss@iki.fi>
Thu, 23 Sep 2010 18:34:31 +0000 (19:34 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 23 Sep 2010 18:34:31 +0000 (19:34 +0100)
src/lib-storage/list/subscription-file.c

index 0feceeddffe26195d8f5a814d188736d4e31304c..fcb0040b207b7b8e1340f1976024b3a649cd328e 100644 (file)
@@ -239,7 +239,15 @@ const char *subsfile_list_next(struct subsfile_list_context *ctx)
         for (i = 0;; i++) {
                 line = next_line(ctx->list, ctx->path, ctx->input, &ctx->failed,
                                 i < SUBSCRIPTION_FILE_ESTALE_RETRY_COUNT);
-                if (ctx->input->stream_errno != ESTALE ||
+               if (line != NULL &&
+                   !mailbox_list_is_valid_pattern(ctx->list, line)) {
+                       /* we'll only get into trouble if we show this */
+                       i_warning("Subscriptions file %s: "
+                                 "Ignoring invalid entry: %s",
+                                 ctx->path, line);
+                       continue;
+               }
+               if (ctx->input->stream_errno != ESTALE ||
                     i == SUBSCRIPTION_FILE_ESTALE_RETRY_COUNT)
                         break;