Add a patch from upstream that fixes a crash with the trash plugin:

Panic: file mail-namespace.c: line 709 (mail_namespace_find): assertion failed: (ns != NULL)

Bump PORTREVISION.

PR:		217364
Submitted by:	Max Kostikov
Obtained from:	326fb016a2.patch
This commit is contained in:
Adam Weinberger 2017-03-01 17:55:58 +00:00
parent 9bc2ff83aa
commit 0185502433
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=435188
2 changed files with 49 additions and 0 deletions

View file

@ -14,6 +14,7 @@
PORTNAME= dovecot PORTNAME= dovecot
PORTVERSION= 2.2.28 PORTVERSION= 2.2.28
PORTREVISION= 1
CATEGORIES= mail ipv6 CATEGORIES= mail ipv6
MASTER_SITES= https://www.dovecot.org/releases/${PORTVERSION:R}/ MASTER_SITES= https://www.dovecot.org/releases/${PORTVERSION:R}/
PKGNAMESUFFIX= 2 PKGNAMESUFFIX= 2

View file

@ -0,0 +1,48 @@
From 326fb016a23480e4ff8dcc03dc80e76812859bd6 Mon Sep 17 00:00:00 2001
From: Aki Tuomi <aki.tuomi@dovecot.fi>
Date: Wed, 1 Mar 2017 09:15:29 +0200
Subject: [PATCH] trash: Read settings after namespaces are loaded
Fixes Panic: file mail-namespace.c: line 709 (mail_namespace_find): assertion failed: (ns != NULL)
---
src/plugins/trash/trash-plugin.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/plugins/trash/trash-plugin.c b/src/plugins/trash/trash-plugin.c
index 7129d3d..2e12578 100644
--- src/plugins/trash/trash-plugin.c
+++ src/plugins/trash/trash-plugin.c
@@ -348,17 +348,27 @@ trash_mail_user_created(struct mail_user *user)
} else {
tuser = p_new(user->pool, struct trash_user, 1);
MODULE_CONTEXT_SET(user, trash_user_module, tuser);
+ }
+}
- if (read_configuration(user, env) == 0) {
- trash_next_quota_test_alloc =
- quser->quota->set->test_alloc;
- quser->quota->set->test_alloc = trash_quota_test_alloc;
- }
+static void
+trash_mail_namespaces_created(struct mail_namespace *namespaces)
+{
+ struct mail_user *user = namespaces->user;
+ struct trash_user *tuser = TRASH_USER_CONTEXT(user);
+ struct quota_user *quser = QUOTA_USER_CONTEXT(user);
+ const char *env = mail_user_plugin_getenv(user, "trash");
+
+ if (tuser != NULL && read_configuration(user, env) == 0) {
+ trash_next_quota_test_alloc =
+ quser->quota->set->test_alloc;
+ quser->quota->set->test_alloc = trash_quota_test_alloc;
}
}
static struct mail_storage_hooks trash_mail_storage_hooks = {
- .mail_user_created = trash_mail_user_created
+ .mail_user_created = trash_mail_user_created,
+ .mail_namespaces_created = trash_mail_namespaces_created,
};
void trash_plugin_init(struct module *module)