dovecot-2.2: lib-storage: Allow MAIL_ATTRIBUTE_INTERNAL_RANK_DEF...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Sep 7 13:41:07 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/04ed3c9c330f
changeset: 19104:04ed3c9c330f
user: Timo Sirainen <tss at iki.fi>
date: Mon Sep 07 16:23:40 2015 +0300
description:
lib-storage: Allow MAIL_ATTRIBUTE_INTERNAL_RANK_DEFAULT to use get=NULL
This is useful for registering internal attributes whose only purpose is to
be able to set/get them via dict. (Because normally the dict access would be
denied completely.)
diffstat:
src/lib-storage/mailbox-attribute.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r 5d3c7d882bfb -r 04ed3c9c330f src/lib-storage/mailbox-attribute.c
--- a/src/lib-storage/mailbox-attribute.c Mon Sep 07 16:22:11 2015 +0300
+++ b/src/lib-storage/mailbox-attribute.c Mon Sep 07 16:23:40 2015 +0300
@@ -282,8 +282,12 @@
if (iattr != NULL) {
switch (iattr->rank) {
case MAIL_ATTRIBUTE_INTERNAL_RANK_DEFAULT:
- if ((ret = iattr->get(t, key, value_r)) < 0)
- return ret;
+ if (iattr->get == NULL)
+ ret = 0;
+ else {
+ if ((ret = iattr->get(t, key, value_r)) < 0)
+ return ret;
+ }
if (ret > 0) {
value_r->flags |= MAIL_ATTRIBUTE_VALUE_FLAG_READONLY;
return 1;
More information about the dovecot-cvs
mailing list