From: Timo Sirainen Date: Thu, 12 Jan 2017 14:20:40 +0000 (+0200) Subject: lib-storage: Allow namespaces_created hook to return failure via user error. X-Git-Tag: 2.3.0.rc1~2319 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=549d0260d615eb51ffcd33b5fc8f9f88368ef05c;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Allow namespaces_created hook to return failure via user error. --- diff --git a/src/lib-storage/mail-namespace.c b/src/lib-storage/mail-namespace.c index 8c03eb24df..9ae113d3a9 100644 --- a/src/lib-storage/mail-namespace.c +++ b/src/lib-storage/mail-namespace.c @@ -384,6 +384,12 @@ int mail_namespaces_init_finish(struct mail_namespace *namespaces, T_BEGIN { hook_mail_namespaces_created(namespaces); } T_END; + + /* allow namespace hooks to return failure via the user error */ + if (namespaces->user->error != NULL) { + *error_r = t_strdup(namespaces->user->error); + return -1; + } return 0; }