You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2012/06/28 21:50:22 UTC

svn commit: r1355136 - in /subversion/branches/authz-overhaul/subversion: include/svn_repos.h libsvn_repos/authz.c libsvn_repos/deprecated.c libsvn_repos/reporter.c libsvn_repos/repos.h

Author: cmpilato
Date: Thu Jun 28 19:50:21 2012
New Revision: 1355136

URL: http://svn.apache.org/viewvc?rev=1355136&view=rev
Log:
On the 'authz-overhaul' branch, make some tweaks to the unified access
function, add some wrappers for compatility with the old approaches,
and begin actually substituting the new functionality.

* subversion/include/svn_repos.h
  (SVN_REPOS_AUTHZ_ACCESS_READ, SVN_REPOS_AUTHZ_ACCESS_READ_RECURSIVE,
   SVN_REPOS_AUTHZ_ACCESS_WRITE, SVN_REPOS_AUTHZ_ACCESS_WRITE_RECURSIVE,
   SVN_REPOS_AUTHZ_ACCESS_EXIST, SVN_REPOS_AUTHZ_ACCESS_EXIST_RECURSIVE,
   svn_repos_authz_func2_t):
    Delete these in favor of...
  (svn_repos_access_t, svn_repos_access_func_t): ...these.  Upgrade
    references throughout this file.

* subversion/libsvn_repos/repos.h
  (svn_repos__upgrade_authz_baton_t): New semi-public baton structure.
  (svn_repos__upgrade_authz_func, svn_repos__upgrade_authz_callback):
    New utility functions.

* subversion/libsvn_repos/authz.c
  (upgrade_authz_func_wrapper, svn_repos__upgrade_authz_func,
   upgrade_authz_callback_wrapper, svn_repos__upgrade_authz_callback):
    New functions.

* subversion/libsvn_repos/reporter.c
  ():Replace authz_read_func/authz_read_baton with the new
    access_func/access_baton throughout.
  (svn_repos_begin_report3): Was svn_repos_begin_report2().

* subversion/libsvn_repos/deprecated.c
  (svn_repos_begin_report2): New implementation of this function, as a
    wrapper around its newer manifestation.

Modified:
    subversion/branches/authz-overhaul/subversion/include/svn_repos.h
    subversion/branches/authz-overhaul/subversion/libsvn_repos/authz.c
    subversion/branches/authz-overhaul/subversion/libsvn_repos/deprecated.c
    subversion/branches/authz-overhaul/subversion/libsvn_repos/reporter.c
    subversion/branches/authz-overhaul/subversion/libsvn_repos/repos.h

Modified: subversion/branches/authz-overhaul/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/authz-overhaul/subversion/include/svn_repos.h?rev=1355136&r1=1355135&r2=1355136&view=diff
==============================================================================
--- subversion/branches/authz-overhaul/subversion/include/svn_repos.h (original)
+++ subversion/branches/authz-overhaul/subversion/include/svn_repos.h Thu Jun 28 19:50:21 2012
@@ -57,44 +57,54 @@ svn_repos_version(void);
 
 
 
-/** Bitflags used (by svn_repos_authz_func2_t's callers and implementers) 
- * to query (and queries about) path-based authorization.
+/** Path access values used by svn_repos_authz_func2_t's callers and
+ * implementers).  These are designed to be numerically comparable.
  *
  * @since New in 1.Y.
  */
-#define SVN_REPOS_AUTHZ_ACCESS_READ                 1  /* read access */
-#define SVN_REPOS_AUTHZ_ACCESS_READ_RECURSIVE       2
-#define SVN_REPOS_AUTHZ_ACCESS_WRITE                4  /* write access */
-#define SVN_REPOS_AUTHZ_ACCESS_WRITE_RECURSIVE      8
-#define SVN_REPOS_AUTHZ_ACCESS_EXIST               16  /* exist-check access */
-#define SVN_REPOS_AUTHZ_ACCESS_EXIST_RECURSIVE     32
+typedef enum
+{
+  /** No access. */
+  svn_repos_access_none = 0,
+
+  /** Path can be known to exist.  This access level is typically not 
+      granted explicitly, but is inferred by virtue of the user
+      havine this or a higher-level access on some child of the
+      tested path.  */
+  svn_repos_access_list,
+
+  /** Path can be read (implies _list) . */
+  svn_repos_access_read,
+
+  /** Path can be altered (implies _list and _read). */
+  svn_repos_access_readwrite
+
+} svn_repos_access_t;
 
 
 /** Callback type for checking authorization on repository paths.
  *
- * Set @a *access to a collection of bitflags (of the @c
- * SVN_REPOS_AUTHZ_ACCESS_* variety) indicating that one or more
- * operations are authorized for @a path in @a root.  @a query is
- * another bitflag collection of the same variety, used to specify for
- * which types of operations the caller wishes to authorize.
- * Implementors are required only to answer the authorization question
- * for the operation types represented in @a query, but may answer
- * additional questions if they see fit.
+ * Set @a *allowed to TRUE iff the @a required access privileges are
+ * granted for @a path to @a depth in @a root.
  *
  * As a special case, if @a path is @c NULL, interpret the query as a
  * global check for authorization of the operation type(s).  (For
- * example, "Is 'write' allowed for anything in the repository?")
- *
- * Do not assume @a pool has any lifetime beyond this call.
+ * example, "Is 'write' allowed for anything in the repository?")  In
+ * such situations, @a root may be @c NULL, too.
  *
+ * Currently, @a depth may only be @c svn_depth_empty or 
+ * @c svn_depth_infinity.
+ * 
  * @since New in 1.Y.
  */
-typedef svn_error_t *(*svn_repos_authz_func2_t)(apr_uint64_t *allowed,
+typedef svn_error_t *(*svn_repos_access_func_t)(svn_boolean_t *allowed,
                                                 svn_fs_root_t *root,
                                                 const char *path,
-                                                apr_uint64_t query,
+                                                svn_repos_access_t required,
+                                                svn_depth_t depth,
                                                 void *baton,
-                                                apr_pool_t *pool);
+                                                apr_pool_t *scratch_pool);
+
 
 /** Similar to the #svn_repos_authz_func2_t() callback type, but
  * with some significant differences.  First, the queried access type
@@ -623,11 +633,11 @@ svn_repos_begin_report3(void **report_ba
                         svn_boolean_t send_copyfrom_args,
                         const svn_delta_editor_t *editor,
                         void *edit_baton,
-                        svn_repos_authz_func2_t authz_func,
-                        void *authz_baton,
+                        svn_repos_access_func_t access_func,
+                        void *access_baton,
                         apr_pool_t *pool);
 
-/** Similar to svn_repos_begin_report3, but uses a #svn_repos_authz_func2_t
+/** Similar to svn_repos_begin_report3, but uses a #svn_repos_access_func_t
  * callback/baton pair instead of an #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -945,15 +955,15 @@ svn_repos_dir_delta3(svn_fs_root_t *src_
                      const char *tgt_path,
                      const svn_delta_editor_t *editor,
                      void *edit_baton,
-                     svn_repos_authz_func2_t authz_func,
-                     void *authz_baton,
+                     svn_repos_access_func_t access_func,
+                     void *access_baton,
                      svn_boolean_t text_deltas,
                      svn_depth_t depth,
                      svn_boolean_t entry_props,
                      svn_boolean_t ignore_ancestry,
                      apr_pool_t *pool);
 
-/** Similar to svn_repos_dir_delta3, but uses a #svn_repos_authz_func2_t
+/** Similar to svn_repos_dir_delta3, but uses a #svn_repos_access_func_t
  * callback/baton pair instead of an #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -1040,11 +1050,11 @@ svn_repos_replay3(svn_fs_root_t *root,
                   svn_boolean_t send_deltas,
                   const svn_delta_editor_t *editor,
                   void *edit_baton,
-                  svn_repos_authz_func2_t authz_func,
-                  void *authz_baton,
+                  svn_repos_access_func_t access_func,
+                  void *access_baton,
                   apr_pool_t *pool);
 
-/** Similar to svn_repos_replay3, but uses a #svn_repos_authz_func2_t
+/** Similar to svn_repos_replay3, but uses a #svn_repos_access_func_t
  * callback/baton pair instead of an #svn_repos_authz_func_t one.
  *
  * @since New in 1.4.
@@ -1134,12 +1144,12 @@ svn_repos_get_commit_editor6(const svn_d
                              apr_hash_t *revprop_table,
                              svn_commit_callback2_t callback,
                              void *callback_baton,
-                             svn_repos_authz_func2_t authz_func,
-                             void *authz_baton,
+                             svn_repos_access_func_t access_func,
+                             void *access_baton,
                              apr_pool_t *pool);
 
 /** Similar to svn_repos_get_commit_editor6, but uses an @c
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -1361,15 +1371,15 @@ svn_repos_history3(svn_fs_t *fs,
                    const char *path,
                    svn_repos_history_func_t history_func,
                    void *history_baton,
-                   svn_repos_authz_func2_t authz_func,
-                   void *authz_baton,
+                   svn_repos_access_func_t access_func,
+                   void *access_baton,
                    svn_revnum_t start,
                    svn_revnum_t end,
                    svn_boolean_t cross_copies,
                    apr_pool_t *pool);
 
 /** Similar to svn_repos_history3, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.1.
@@ -1432,12 +1442,12 @@ svn_repos_trace_node_locations2(svn_fs_t
                                 const char *fs_path,
                                 svn_revnum_t peg_revision,
                                 apr_array_header_t *location_revisions,
-                                svn_repos_authz_func2_t authz_func,
-                                void *authz_baton,
+                                svn_repos_access_func_t access_func,
+                                void *access_baton,
                                 apr_pool_t *pool);
 
 /** Similar to svn_repos_trace_node_locations2, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.1.
@@ -1491,12 +1501,12 @@ svn_repos_node_location_segments2(svn_re
                                   svn_revnum_t end_rev,
                                   svn_location_segment_receiver_t receiver,
                                   void *receiver_baton,
-                                  svn_repos_authz_func2_t authz_func,
-                                  void *authz_baton,
+                                  svn_repos_access_func_t access_func,
+                                  void *access_baton,
                                   apr_pool_t *pool);
 
 /** Similar to svn_repos_node_location_segments2, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -1595,14 +1605,14 @@ svn_repos_get_logs5(svn_repos_t *repos,
                     svn_boolean_t strict_node_history,
                     svn_boolean_t include_merged_revisions,
                     const apr_array_header_t *revprops,
-                    svn_repos_authz_func2_t authz_func,
-                    void *authz_baton,
+                    svn_repos_access_func_t access_func,
+                    void *access_baton,
                     svn_log_entry_receiver_t receiver,
                     void *receiver_baton,
                     apr_pool_t *pool);
 
 /** Similar to svn_repos_get_logs5, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -1727,12 +1737,12 @@ svn_repos_fs_get_mergeinfo2(svn_mergeinf
                             svn_revnum_t revision,
                             svn_mergeinfo_inheritance_t inherit,
                             svn_boolean_t include_descendants,
-                            svn_repos_authz_func2_t authz_func,
-                            void *authz_baton,
+                            svn_repos_access_func_t access_func,
+                            void *access_baton,
                             apr_pool_t *pool);
 
 /** Similar to svn_repos_fs_get_mergeinfo2, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -1810,14 +1820,14 @@ svn_repos_get_file_revs3(svn_repos_t *re
                          svn_revnum_t start,
                          svn_revnum_t end,
                          svn_boolean_t include_merged_revisions,
-                         svn_repos_authz_func2_t authz_func,
-                         void *authz_baton,
+                         svn_repos_access_func_t access_func,
+                         void *access_baton,
                          svn_file_rev_handler_t handler,
                          void *handler_baton,
                          apr_pool_t *pool);
 
 /** Similar to svn_repos_get_file_revs3, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -2008,12 +2018,12 @@ svn_error_t *
 svn_repos_fs_get_locks2(apr_hash_t **locks,
                         svn_repos_t *repos,
                         const char *path,
-                        svn_repos_authz_func2_t authz_func,
-                        void *authz_baton,
+                        svn_repos_access_func_t access_func,
+                        void *access_baton,
                         apr_pool_t *pool);
 
 /** Similar to svn_repos_fs_get_locks2, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.2.
@@ -2061,12 +2071,12 @@ svn_repos_fs_change_rev_prop4(svn_repos_
                               const svn_string_t *new_value,
                               svn_boolean_t use_pre_revprop_change_hook,
                               svn_boolean_t use_post_revprop_change_hook,
-                              svn_repos_authz_func2_t authz_func,
-                              void *authz_baton,
+                              svn_repos_access_func_t access_func,
+                              void *access_baton,
                               apr_pool_t *pool);
 
 /** Similar to svn_repos_fs_change_rev_prop4, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.
@@ -2141,12 +2151,12 @@ svn_repos_fs_revision_prop2(svn_string_t
                             svn_repos_t *repos,
                             svn_revnum_t rev,
                             const char *propname,
-                            svn_repos_authz_func2_t authz_func,
-                            void *authz_baton,
+                            svn_repos_access_func_t access_func,
+                            void *access_baton,
                             apr_pool_t *pool);
 
 /** Similar to svn_repos_fs_revision_prop2, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.1.
@@ -2183,12 +2193,12 @@ svn_error_t *
 svn_repos_fs_revision_proplist2(apr_hash_t **table_p,
                                 svn_repos_t *repos,
                                 svn_revnum_t rev,
-                                svn_repos_authz_func2_t authz_func,
-                                void *authz_baton,
+                                svn_repos_access_func_t access_func,
+                                void *access_baton,
                                 apr_pool_t *pool);
 
 /** Similar to svn_repos_fs_revision_proplist2, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.1.
@@ -2953,12 +2963,12 @@ svn_error_t *
 svn_repos_check_revision_access2(svn_repos_revision_access_level_t *access_level,
                                  svn_repos_t *repos,
                                  svn_revnum_t revision,
-                                 svn_repos_authz_func2_t authz_func,
-                                 void *authz_baton,
+                                 svn_repos_access_func_t access_func,
+                                 void *access_baton,
                                  apr_pool_t *pool);
 
 /** Similar to svn_repos_check_revision_access2, but uses an
- * #svn_repos_authz_func2_t callback/baton pair instead of an 
+ * #svn_repos_access_func_t callback/baton pair instead of an 
  * #svn_repos_authz_func_t one.
  *
  * @since New in 1.5.

Modified: subversion/branches/authz-overhaul/subversion/libsvn_repos/authz.c
URL: http://svn.apache.org/viewvc/subversion/branches/authz-overhaul/subversion/libsvn_repos/authz.c?rev=1355136&r1=1355135&r2=1355136&view=diff
==============================================================================
--- subversion/branches/authz-overhaul/subversion/libsvn_repos/authz.c (original)
+++ subversion/branches/authz-overhaul/subversion/libsvn_repos/authz.c Thu Jun 28 19:50:21 2012
@@ -33,6 +33,7 @@
 #include "svn_repos.h"
 #include "svn_config.h"
 #include "svn_ctype.h"
+#include "repos.h"
 
 
 /*** Structures. ***/
@@ -781,3 +782,94 @@ svn_repos_authz_check_access(svn_authz_t
 
   return SVN_NO_ERROR;
 }
+
+
+
+/*** Wrappers around old-style authz callbacks. ***/
+
+static svn_error_t *
+upgrade_authz_func_wrapper(svn_boolean_t *allowed,
+                           svn_fs_root_t *root,
+                           const char *path,
+                           svn_repos_access_t required,
+                           svn_depth_t depth,
+                           void *baton,
+                           apr_pool_t *scratch_pool)
+{
+  svn_repos__upgrade_authz_baton_t *b = baton;
+
+  /* Callers shouldn't be asking about write permission via this
+     interface. */
+  SVN_ERR_ASSERT(required && (required < svn_repos_access_readwrite));
+  SVN_ERR_ASSERT(b->authz_callback);
+
+  return svn_error_return(b->authz_func(allowed, root, path,
+                                        b->authz_func_baton, scratch_pool));
+}
+
+
+svn_error_t *
+svn_repos__upgrade_authz_func(svn_repos_access_func_t *access_func,
+                              void **access_baton,
+                              svn_repos_authz_func_t authz_read_func,
+                              void *authz_baton,
+                              apr_pool_t *pool)
+{
+  svn_repos__upgrade_authz_baton_t *new_baton =
+    apr_pcalloc(pool, sizeof(*new_baton));
+
+  new_baton->authz_func = authz_read_func;
+  new_baton->authz_func_baton = authz_baton;
+  *access_func = upgrade_authz_func_wrapper;
+  *access_baton = new_baton;
+  return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+upgrade_authz_callback_wrapper(svn_boolean_t *allowed,
+                               svn_fs_root_t *root,
+                               const char *path,
+                               svn_repos_access_t required,
+                               svn_depth_t depth,
+                               void *baton,
+                               apr_pool_t *scratch_pool)
+{
+  svn_repos__upgrade_authz_baton_t *b = baton;
+  svn_repos_authz_access_t authz_required;
+
+  SVN_ERR_ASSERT(required);
+  SVN_ERR_ASSERT((depth == svn_depth_empty) || (depth == svn_depth_infinity));
+  SVN_ERR_ASSERT(b->authz_callback);
+
+  if (required == svn_repos_access_readwrite)
+    authz_required = svn_authz_write;
+  else if (required <= svn_repos_access_read)
+    authz_required = svn_authz_read;
+
+  if (depth == svn_depth_infinity)
+    authz_required |= svn_authz_recursive;
+
+  return svn_error_return(b->authz_callback(authz_required, allowed, root,
+                                            path, b->authz_callback_baton,
+                                            scratch_pool));
+}
+
+
+svn_error_t *
+svn_repos__upgrade_authz_callback(svn_repos_access_func_t *access_func,
+                                  void **access_baton,
+                                  svn_repos_authz_callback_t authz_callback,
+                                  void *authz_baton,
+                                  apr_pool_t *pool)
+{
+  svn_repos__upgrade_authz_baton_t *new_baton =
+    apr_pcalloc(pool, sizeof(*new_baton));
+
+  new_baton->authz_callback = authz_callback;
+  new_baton->authz_callback_baton = authz_baton;
+  *access_func = upgrade_authz_callback_wrapper;
+  *access_baton = new_baton;
+  return SVN_NO_ERROR;
+}
+

Modified: subversion/branches/authz-overhaul/subversion/libsvn_repos/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/authz-overhaul/subversion/libsvn_repos/deprecated.c?rev=1355136&r1=1355135&r2=1355136&view=diff
==============================================================================
--- subversion/branches/authz-overhaul/subversion/libsvn_repos/deprecated.c (original)
+++ subversion/branches/authz-overhaul/subversion/libsvn_repos/deprecated.c Thu Jun 28 19:50:21 2012
@@ -32,6 +32,8 @@
 
 #include "svn_private_config.h"
 
+#include "repos.h"
+
 
 
 
@@ -159,6 +161,36 @@ svn_repos_recover(const char *path,
 
 /*** From reporter.c ***/
 svn_error_t *
+svn_repos_begin_report2(void **report_baton,
+                        svn_revnum_t revnum,
+                        svn_repos_t *repos,
+                        const char *fs_base,
+                        const char *s_operand,
+                        const char *switch_path,
+                        svn_boolean_t text_deltas,
+                        svn_depth_t depth,
+                        svn_boolean_t ignore_ancestry,
+                        svn_boolean_t send_copyfrom_args,
+                        const svn_delta_editor_t *editor,
+                        void *edit_baton,
+                        svn_repos_authz_func_t authz_read_func,
+                        void *authz_read_baton,
+                        apr_pool_t *pool)
+{
+  svn_repos_access_func_t access_func;
+  void *access_baton;
+
+  SVN_ERR(svn_repos__upgrade_authz_func(&access_func, &access_baton,
+                                        authz_read_func, authz_read_baton,
+                                        pool));
+  return svn_repos_begin_report3(report_baton, revnum, repos, fs_base,
+                                 s_operand, switch_path, text_deltas,
+                                 depth, ignore_ancestry, send_copyfrom_args,
+                                 editor, edit_baton, access_func,
+                                 access_baton, pool);
+}
+
+svn_error_t *
 svn_repos_begin_report(void **report_baton,
                        svn_revnum_t revnum,
                        const char *username,

Modified: subversion/branches/authz-overhaul/subversion/libsvn_repos/reporter.c
URL: http://svn.apache.org/viewvc/subversion/branches/authz-overhaul/subversion/libsvn_repos/reporter.c?rev=1355136&r1=1355135&r2=1355136&view=diff
==============================================================================
--- subversion/branches/authz-overhaul/subversion/libsvn_repos/reporter.c (original)
+++ subversion/branches/authz-overhaul/subversion/libsvn_repos/reporter.c Thu Jun 28 19:50:21 2012
@@ -106,8 +106,8 @@ typedef struct report_baton_t
   svn_boolean_t is_switch;
   const svn_delta_editor_t *editor;
   void *edit_baton;
-  svn_repos_authz_func_t authz_read_func;
-  void *authz_read_baton;
+  svn_repos_access_func_t access_func;
+  void *access_baton;
 
   /* The temporary file in which we are stashing the report. */
   apr_file_t *tempfile;
@@ -589,9 +589,9 @@ static svn_error_t *
 check_auth(report_baton_t *b, svn_boolean_t *allowed, const char *path,
            apr_pool_t *pool)
 {
-  if (b->authz_read_func)
-    return b->authz_read_func(allowed, b->t_root, path,
-                              b->authz_read_baton, pool);
+  if (b->access_func)
+    return b->access_func(allowed, b->t_root, path, svn_repos_access_read,
+                          svn_depth_empty, b->access_baton, pool);
   *allowed = TRUE;
   return SVN_NO_ERROR;
 }
@@ -698,15 +698,18 @@ add_file_smartly(report_baton_t *b,
               SVN_ERR(svn_fs_copied_from(copyfrom_rev, copyfrom_path,
                                          closest_copy_root, closest_copy_path,
                                          pool));
-              if (b->authz_read_func)
+              if (b->access_func)
                 {
                   svn_boolean_t allowed;
                   svn_fs_root_t *copyfrom_root;
                   SVN_ERR(svn_fs_revision_root(&copyfrom_root, fs,
                                                *copyfrom_rev, pool));
-                  SVN_ERR(b->authz_read_func(&allowed, copyfrom_root,
-                                             *copyfrom_path, b->authz_read_baton,
-                                             pool));
+                  SVN_ERR(b->access_func(&allowed,
+                                         copyfrom_root,
+                                         *copyfrom_path,
+                                         svn_repos_access_read,
+                                         svn_depth_empty,
+                                         b->access_baton, pool));
                   if (! allowed)
                     {
                       *copyfrom_path = NULL;
@@ -1368,7 +1371,7 @@ svn_repos_abort_report(void *baton, apr_
 
 
 svn_error_t *
-svn_repos_begin_report2(void **report_baton,
+svn_repos_begin_report3(void **report_baton,
                         svn_revnum_t revnum,
                         svn_repos_t *repos,
                         const char *fs_base,
@@ -1380,8 +1383,8 @@ svn_repos_begin_report2(void **report_ba
                         svn_boolean_t send_copyfrom_args,
                         const svn_delta_editor_t *editor,
                         void *edit_baton,
-                        svn_repos_authz_func_t authz_read_func,
-                        void *authz_read_baton,
+                        svn_repos_access_func_t access_func,
+                        void *access_baton,
                         apr_pool_t *pool)
 {
   report_baton_t *b;
@@ -1406,8 +1409,8 @@ svn_repos_begin_report2(void **report_ba
   b->is_switch = (switch_path != NULL);
   b->editor = editor;
   b->edit_baton = edit_baton;
-  b->authz_read_func = authz_read_func;
-  b->authz_read_baton = authz_read_baton;
+  b->access_func = access_func;
+  b->access_baton = access_baton;
 
   SVN_ERR(svn_io_open_unique_file3(&b->tempfile, NULL, NULL,
                                    svn_io_file_del_on_pool_cleanup,

Modified: subversion/branches/authz-overhaul/subversion/libsvn_repos/repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/authz-overhaul/subversion/libsvn_repos/repos.h?rev=1355136&r1=1355135&r2=1355136&view=diff
==============================================================================
--- subversion/branches/authz-overhaul/subversion/libsvn_repos/repos.h (original)
+++ subversion/branches/authz-overhaul/subversion/libsvn_repos/repos.h Thu Jun 28 19:50:21 2012
@@ -355,6 +355,41 @@ svn_repos__prev_location(svn_revnum_t *a
                          const char *path,
                          apr_pool_t *pool);
 
+
+/*** Compatibility Wrappers ***/
+
+typedef struct svn_repos__upgrade_authz_baton_t 
+{
+  svn_repos_authz_func_t authz_func;
+  void *authz_func_baton;
+
+  svn_repos_authz_callback_t authz_callback;
+  void *authz_callback_baton;
+
+} svn_repos__upgrade_authz_baton_t;
+
+
+/* Set *access_func and **access_baton to a function/baton pair which
+   wrap the functionality of authz_read_func/authz_baton with the new
+   svn_repos_access_func_t behavior. */
+svn_error_t *
+svn_repos__upgrade_authz_func(svn_repos_access_func_t *access_func,
+                              void **access_baton,
+                              svn_repos_authz_func_t authz_read_func,
+                              void *authz_baton,
+                              apr_pool_t *pool);
+
+
+/* Set *access_func and **access_baton to a function/baton pair which
+   wrap the functionality of authz_callback/authz_baton with the new
+   svn_repos_access_func_t behavior. */
+svn_error_t *
+svn_repos__upgrade_authz_callback(svn_repos_access_func_t *access_func,
+                                  void **access_baton,
+                                  svn_repos_authz_callback_t authz_callback,
+                                  void *authz_baton,
+                                  apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */