]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Use MAIL_ERROR_NOTPOSSIBLE if mailbox_attribute_*set() fails for read...
authorTimo Sirainen <tss@iki.fi>
Tue, 8 Sep 2015 15:45:28 +0000 (18:45 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 8 Sep 2015 15:45:28 +0000 (18:45 +0300)
MAIL_ERROR_PARAMS indicates that there was something wrong with the
parameters itself. But the caller can't know (at least with current APIs)
if it's a read-only attribute it's trying to change before actually doing it.

src/lib-storage/mailbox-attribute.c

index cc9f2b5d68d25a2e764b0c3b1a6e651c3061f351..41e331b467e42fdaefc381677d0e34c89705f23e 100644 (file)
@@ -172,7 +172,7 @@ mailbox_attribute_set_common(struct mailbox_transaction_context *t,
                        break;
                case MAIL_ATTRIBUTE_INTERNAL_RANK_AUTHORITY:
                        if (iattr->set == NULL) {
-                               mail_storage_set_error(t->box->storage, MAIL_ERROR_PARAMS, t_strdup_printf(
+                               mail_storage_set_error(t->box->storage, MAIL_ERROR_NOTPOSSIBLE, t_strdup_printf(
                                        "The /%s/%s attribute cannot be changed",
                                        (type == MAIL_ATTRIBUTE_TYPE_SHARED ? "shared" : "private"), key));
                                return -1;