Skip to content

Commit

Permalink
lib-storage: remove attribute accessibility checks
Browse files Browse the repository at this point in the history
index_storage_attribute_{set,get} should assume that the caller performed
due diligence and checked whether or not the user is allowed to store under
the key.
  • Loading branch information
Josef 'Jeff' Sipek committed Sep 26, 2016
1 parent f9c0271 commit 0878b1e
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/lib-storage/index/index-attribute.c
Expand Up @@ -197,13 +197,6 @@ int index_storage_attribute_set(struct mailbox_transaction_context *t,
time_t ts = value->last_change != 0 ? value->last_change : ioloop_time;
int ret = 0;

if (!t->internal_attribute &&
!MAILBOX_ATTRIBUTE_KEY_IS_USER_ACCESSIBLE(key)) {
mail_storage_set_error(t->box->storage, MAIL_ERROR_PARAMS,
"Internal attributes cannot be changed directly");
return -1;
}

if (index_storage_attribute_get_dict_trans(t, type, &dtrans,
&mailbox_prefix) < 0)
return -1;
Expand Down Expand Up @@ -238,10 +231,6 @@ int index_storage_attribute_get(struct mailbox_transaction_context *t,

memset(value_r, 0, sizeof(*value_r));

if (!t->internal_attribute &&
!MAILBOX_ATTRIBUTE_KEY_IS_USER_ACCESSIBLE(key))
return 0;

if (index_storage_get_dict(t->box, type, &dict, &mailbox_prefix) < 0)
return -1;

Expand Down

0 comments on commit 0878b1e

Please sign in to comment.