]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: acl_backend_vfile_has_acl() - Simplify code
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 16 Sep 2021 16:32:02 +0000 (19:32 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 17 Sep 2021 16:14:13 +0000 (16:14 +0000)
src/plugins/acl/acl-backend-vfile.c

index 8d70303c30ce6aca600590284f25b19611da2f73..3ee0af996f0f92bc9a565d818e06799ef09c0745 100644 (file)
@@ -243,16 +243,16 @@ acl_backend_vfile_has_acl(struct acl_backend *_backend, const char *name)
        if (backend->global_path == NULL) {
                /* global ACLs disabled */
                ret = 0;
+       } else if (_backend->global_file != NULL) {
+               /* check global ACL file */
+               ret = acl_global_file_refresh(_backend->global_file);
+               if (ret == 0 && acl_global_file_have_any(_backend->global_file, box->vname))
+                       ret = 1;
        } else {
-               if (_backend->global_file != NULL) {
-                       ret = acl_global_file_refresh(_backend->global_file);
-                       if (ret == 0 && acl_global_file_have_any(_backend->global_file, box->vname))
-                               ret = 1;
-               } else {
-                       global_path = t_strconcat(backend->global_path, "/", name, NULL);
-                       ret = acl_backend_vfile_exists(backend, global_path,
-                                                      &new_validity.global_validity);
-               }
+               /* check global ACL directory */
+               global_path = t_strconcat(backend->global_path, "/", name, NULL);
+               ret = acl_backend_vfile_exists(backend, global_path,
+                                              &new_validity.global_validity);
        }
 
        if (ret != 0) {