From: Aki Tuomi Date: Thu, 25 Jan 2024 14:27:14 +0000 (+0200) Subject: plugins: acl - Drop unused can_see_r from acl_mailbox_list_have_right() X-Git-Tag: 2.4.1~1154 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=737bc607336a03fc80e790adcb20fc0ed783e7b2;p=thirdparty%2Fdovecot%2Fcore.git plugins: acl - Drop unused can_see_r from acl_mailbox_list_have_right() --- diff --git a/src/plugins/acl/acl-mailbox-list.c b/src/plugins/acl/acl-mailbox-list.c index f4eeabe5ee..5f091f5a10 100644 --- a/src/plugins/acl/acl-mailbox-list.c +++ b/src/plugins/acl/acl-mailbox-list.c @@ -54,14 +54,13 @@ struct acl_backend *acl_mailbox_list_get_backend(struct mailbox_list *list) } int acl_mailbox_list_have_right(struct mailbox_list *list, const char *name, - bool parent, unsigned int acl_storage_right_idx, - bool *can_see_r) + bool parent, unsigned int acl_storage_right_idx) { struct acl_mailbox_list *alist = ACL_LIST_CONTEXT_REQUIRE(list); struct acl_backend *backend = alist->rights.backend; const unsigned int *idx_arr = alist->rights.acl_storage_right_idx; struct acl_object *aclobj; - int ret, ret2; + int ret; if (backend->set->acl_ignore) return 1; @@ -71,13 +70,6 @@ int acl_mailbox_list_have_right(struct mailbox_list *list, const char *name, acl_object_init_from_parent(backend, name); ret = acl_object_have_right(aclobj, idx_arr[acl_storage_right_idx]); - if (can_see_r != NULL) { - ret2 = acl_object_have_right(aclobj, - idx_arr[ACL_STORAGE_RIGHT_LOOKUP]); - if (ret2 < 0) - ret = -1; - *can_see_r = ret2 > 0; - } acl_object_deinit(&aclobj); if (ret < 0) @@ -370,8 +362,7 @@ acl_mailbox_list_info_is_visible(struct mailbox_list_iterate_context *_ctx) acl_name = acl_mailbox_list_iter_get_name(_ctx, info->vname); ret = acl_mailbox_list_have_right(_ctx->list, acl_name, FALSE, - ACL_STORAGE_RIGHT_LOOKUP, - NULL); + ACL_STORAGE_RIGHT_LOOKUP); if (ret != 0) { if ((_ctx->flags & MAILBOX_LIST_ITER_RETURN_NO_FLAGS) != 0) { /* don't waste time checking if there are visible @@ -443,8 +434,7 @@ acl_mailbox_list_iter_check_autocreate_acls(struct mailbox_list_iterate_context const char *acl_name = acl_mailbox_list_iter_get_name(_ctx, box_sets[i]->name); ret = acl_mailbox_list_have_right(_ctx->list, acl_name, FALSE, - ACL_STORAGE_RIGHT_LOOKUP, - NULL); + ACL_STORAGE_RIGHT_LOOKUP); if (ret > 0) i++; else if (ret == 0) { diff --git a/src/plugins/acl/acl-mailbox.c b/src/plugins/acl/acl-mailbox.c index ae6c5d66e3..d373e62c1a 100644 --- a/src/plugins/acl/acl-mailbox.c +++ b/src/plugins/acl/acl-mailbox.c @@ -129,7 +129,7 @@ acl_mailbox_create(struct mailbox *box, const struct mailbox_update *update, if (!mailbox_is_autocreated(box)) { /* we're looking up CREATE permission from our parent's rights */ ret = acl_mailbox_list_have_right(box->list, box->name, TRUE, - ACL_STORAGE_RIGHT_CREATE, NULL); + ACL_STORAGE_RIGHT_CREATE); } else { /* mailbox is autocreated, so we need to treat it as if it already exists. ignore the "create" ACL here. */ @@ -225,7 +225,7 @@ acl_mailbox_rename(struct mailbox *src, struct mailbox *dest) /* and create the new one under the parent mailbox */ T_BEGIN { ret = acl_mailbox_list_have_right(dest->list, dest->name, TRUE, - ACL_STORAGE_RIGHT_CREATE, NULL); + ACL_STORAGE_RIGHT_CREATE); } T_END; if (ret <= 0) { diff --git a/src/plugins/acl/acl-plugin.h b/src/plugins/acl/acl-plugin.h index f142c8da55..4b4c74ae04 100644 --- a/src/plugins/acl/acl-plugin.h +++ b/src/plugins/acl/acl-plugin.h @@ -59,8 +59,7 @@ void acl_mail_allocated(struct mail *mail); struct acl_backend *acl_mailbox_list_get_backend(struct mailbox_list *list); int acl_mailbox_list_have_right(struct mailbox_list *list, const char *name, - bool parent, unsigned int acl_storage_right_idx, - bool *can_see_r) ATTR_NULL(5); + bool parent, unsigned int acl_storage_right_idx); void acl_plugin_init(struct module *module); void acl_plugin_deinit(void);