subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1775554 - /subversion/branches/authzperf/subversion/libsvn_repos/authz.c
Date Wed, 21 Dec 2016 19:56:35 GMT
Author: stefan2
Date: Wed Dec 21 19:56:35 2016
New Revision: 1775554

URL: http://svn.apache.org/viewvc?rev=1775554&view=rev
Log:
On the authzperf branch:
Minor code cleanup.

* subversion/libsvn_repos/authz.c
  (svn_repos_authz_check_access): PATH cannot be NULL at that point anymore.

Modified:
    subversion/branches/authzperf/subversion/libsvn_repos/authz.c

Modified: subversion/branches/authzperf/subversion/libsvn_repos/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/authzperf/subversion/libsvn_repos/authz.c?rev=1775554&r1=1775553&r2=1775554&view=diff
==============================================================================
--- subversion/branches/authzperf/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/authzperf/subversion/libsvn_repos/authz.c Wed Dec 21 19:56:35 2016
@@ -1703,34 +1703,23 @@ svn_repos_authz_check_access(svn_authz_t
       return SVN_NO_ERROR;
     }
 
+  /* Rules tree lookup */
+
   /* Did we already filter the data model? */
   if (!rules->root)
     SVN_ERR(filter_tree(authz, pool));
 
-  /* If PATH is NULL, check if the user has *any* access. */
-  if (!path)
-    {
-      *access_granted =
-        ((rules->root->rights.max_rights & required) == required);
-      return SVN_NO_ERROR;
-    }
-  else
-    {
-      const svn_boolean_t recursive =
-        !!(required_access & svn_authz_recursive);
-
-      /* Re-use previous lookup results, if possible. */
-      path = init_lockup_state(authz->filtered->lookup_state,
-                               authz->filtered->root, path);
-
-      /* Sanity check. */
-      SVN_ERR_ASSERT(path[0] == '/');
-
-      /* Determine the granted access for the requested path.
-       * PATH does not need to be normalized for lockup(). */
-      *access_granted = lookup(rules->lookup_state, path,
-                               required, recursive, pool);
-    }
+  /* Re-use previous lookup results, if possible. */
+  path = init_lockup_state(authz->filtered->lookup_state,
+                           authz->filtered->root, path);
+
+  /* Sanity check. */
+  SVN_ERR_ASSERT(path[0] == '/');
+
+  /* Determine the granted access for the requested path.
+   * PATH does not need to be normalized for lockup(). */
+  *access_granted = lookup(rules->lookup_state, path, required,
+                           !!(required_access & svn_authz_recursive), pool);
 
   return SVN_NO_ERROR;
 }



Mime
View raw message