acl-attributes.c revision 5f63ee5a915d1b6a89b36a68a00d82ff678fc450
/* Copyright (c) 2013-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "mail-storage-private.h"
#include "acl-api-private.h"
#include "acl-plugin.h"
#include "acl-storage.h"
struct acl_mailbox_attribute_iter {
struct mailbox_attribute_iter iter;
struct mailbox_attribute_iter *super;
struct acl_object_list_iter *acl_iter;
bool failed;
};
static int
const struct mail_attribute_value *value)
{
struct acl_rights_update update;
/* for now allow only dsync to update ACLs this way.
if this check is removed, it should be replaced by a setting, since
some admins may still have configured Dovecot using dovecot-acl
files directly that they don't want users to update. and in any case
ACL_STORAGE_RIGHT_ADMIN must be checked then. */
return -1;
}
&value_str) < 0)
return -1;
return -1;
}
/* FIXME: this should actually be done only at commit().. */
return acl_mailbox_update_acl(t, &update);
}
struct mail_attribute_value *value_r)
{
struct acl_object_list_iter *iter;
const char *id;
int ret;
return -1;
}
/* set last_change for all ACL objects, even if they don't exist
(because they could have been removed by the last change, and dsync
can use this information) */
return -1;
}
break;
}
}
return ret;
}
{
int ret;
/* deleting attributes during mailbox deletion */
return 1;
}
/* RFC 5464:
When the ACL extension [RFC4314] is present, users can only set and
retrieve private or shared mailbox annotations on a mailbox on which
they have the "l" right and any one of the "r", "s", "w", "i", or "p"
rights.
*/
if (ret <= 0) {
if (ret < 0)
return -1;
return -1;
}
return 0;
return 0;
return 0;
return 0;
return 0;
return -1;
}
int acl_attribute_set(struct mailbox_transaction_context *t,
const struct mail_attribute_value *value,
bool internal_attribute)
{
if (acl_have_attribute_rights(t->box) < 0)
return -1;
strlen(MAILBOX_ATTRIBUTE_PREFIX_ACL)) == 0)
}
struct mail_attribute_value *value_r,
bool internal_attribute)
{
if (acl_have_attribute_rights(box) < 0)
return -1;
strlen(MAILBOX_ATTRIBUTE_PREFIX_ACL)) == 0)
}
struct mailbox_attribute_iter *
const char *prefix)
{
struct acl_mailbox_attribute_iter *aiter;
if (acl_have_attribute_rights(box) < 0)
else {
}
}
}
static const char *
{
struct acl_rights rights;
return NULL;
continue;
}
}
return NULL;
}
{
struct acl_mailbox_attribute_iter *aiter =
(struct acl_mailbox_attribute_iter *)iter;
const char *key;
return NULL;
return key;
}
}
{
struct acl_mailbox_attribute_iter *aiter =
(struct acl_mailbox_attribute_iter *)iter;
ret = -1;
}
ret = -1;
}
return ret;
}