From: Timo Sirainen Date: Thu, 23 Sep 2010 18:34:31 +0000 (+0100) Subject: lib-storage: Log and hide invalid entries in subscriptions file. X-Git-Tag: 2.0.4~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be04e84a9e51b5ea71ad07d35884e37ccefecc83;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Log and hide invalid entries in subscriptions file. --- 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;