From be04e84a9e51b5ea71ad07d35884e37ccefecc83 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 23 Sep 2010 19:34:31 +0100 Subject: [PATCH] lib-storage: Log and hide invalid entries in subscriptions file. --- src/lib-storage/list/subscription-file.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib-storage/list/subscription-file.c b/src/lib-storage/list/subscription-file.c index 0feceeddff..fcb0040b20 100644 --- a/src/lib-storage/list/subscription-file.c +++ b/src/lib-storage/list/subscription-file.c @@ -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; -- 2.47.3