]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins: acl - Drop unused can_see_r from acl_mailbox_list_have_right()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 25 Jan 2024 14:27:14 +0000 (16:27 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:11 +0000 (12:34 +0200)
src/plugins/acl/acl-mailbox-list.c
src/plugins/acl/acl-mailbox.c
src/plugins/acl/acl-plugin.h

index f4eeabe5eef9353b327299ae0d7c04b691e94439..5f091f5a109f4fdc1615f39a80152f925765a254 100644 (file)
@@ -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) {
index ae6c5d66e3b2faa9e07dd24d3ee5da885b2baba7..d373e62c1aee00089524fe68ea00fa2782ff1521 100644 (file)
@@ -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) {
index f142c8da553aea907ec3f3609d90182cc78e7e01..4b4c74ae045b47f162d1f593d3a5a3d32db2ff9f 100644 (file)
@@ -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);