View | Details | Raw Unified | Return to bug 60610
Collapse All | Expand All

(-)subversion/mod_dav_svn/update.c (-20 / +9 lines)
Lines 102-125 Link Here
102
#define DIR_OR_FILE(is_dir) ((is_dir) ? "directory" : "file")
102
#define DIR_OR_FILE(is_dir) ((is_dir) ? "directory" : "file")
103
103
104
104
105
struct authz_read_baton
105
svn_error_t *dav_svn_authz_read(svn_boolean_t *allowed,
106
                                svn_fs_root_t *root,
107
                                const char *path,
108
                                void *baton,
109
                                apr_pool_t *pool)
106
{
110
{
107
  /* The original request, needed to generate a subrequest. */
111
  dav_svn_authz_read_baton *arb = baton;
108
  request_rec *r;
109
110
  /* We need this to construct a URI based on a repository abs path. */
111
  const dav_svn_repos *repos;
112
};
113
114
115
/* This implements 'svn_repos_authz_func_t'. */
116
static svn_error_t *authz_read(svn_boolean_t *allowed,
117
                               svn_fs_root_t *root,
118
                               const char *path,
119
                               void *baton,
120
                               apr_pool_t *pool)
121
{
122
  struct authz_read_baton *arb = baton;
123
  request_rec *subreq = NULL;
112
  request_rec *subreq = NULL;
124
  const char *uri;
113
  const char *uri;
125
  svn_revnum_t rev = SVN_INVALID_REVNUM;
114
  svn_revnum_t rev = SVN_INVALID_REVNUM;
Lines 1002-1008 Link Here
1002
  svn_boolean_t recurse = TRUE;
991
  svn_boolean_t recurse = TRUE;
1003
  svn_boolean_t resource_walk = FALSE;
992
  svn_boolean_t resource_walk = FALSE;
1004
  svn_boolean_t ignore_ancestry = FALSE;
993
  svn_boolean_t ignore_ancestry = FALSE;
1005
  struct authz_read_baton arb;
994
  dav_svn_authz_read_baton arb;
1006
  apr_pool_t *subpool = svn_pool_create(resource->pool);
995
  apr_pool_t *subpool = svn_pool_create(resource->pool);
1007
996
1008
  /* Construct the authz read check baton. */
997
  /* Construct the authz read check baton. */
Lines 1243-1249 Link Here
1243
                                     recurse,
1232
                                     recurse,
1244
                                     ignore_ancestry,
1233
                                     ignore_ancestry,
1245
                                     editor, &uc,
1234
                                     editor, &uc,
1246
                                     authz_read,
1235
                                     dav_svn_authz_read,
1247
                                     &arb,
1236
                                     &arb,
1248
                                     resource->pool)))
1237
                                     resource->pool)))
1249
    {
1238
    {
Lines 1412-1418 Link Here
1412
                                     uc.rev_root, dst_path,
1401
                                     uc.rev_root, dst_path,
1413
                                     /* re-use the editor */
1402
                                     /* re-use the editor */
1414
                                     editor, &uc,
1403
                                     editor, &uc,
1415
                                     authz_read,
1404
                                     dav_svn_authz_read,
1416
                                     &arb,
1405
                                     &arb,
1417
                                     FALSE, /* no text deltas */
1406
                                     FALSE, /* no text deltas */
1418
                                     recurse,
1407
                                     recurse,
(-)subversion/mod_dav_svn/dav_svn.h (+32 lines)
Lines 506-511 Link Here
506
506
507
507
508
508
509
510
/* A baton needed by dav_svn_authz_read(). */
511
typedef struct 
512
{
513
  /* The original request, needed to generate a subrequest. */
514
  request_rec *r;
515
516
  /* We need this to construct a URI based on a repository abs path. */
517
  const dav_svn_repos *repos;
518
519
} dav_svn_authz_read_baton;
520
521
522
/* This function implements 'svn_repos_authz_func_t', specifically
523
   for read authorization.
524
525
   Convert incoming ROOT and PATH into a version-resource URI and
526
   perform a GET subrequest on it.  This will invoke any authz modules
527
   loaded into apache.  Set *ALLOWED to TRUE if the subrequest
528
   succeeds, FALSE otherwise.
529
530
   BATON must be a pointer to a dav_svn_authz_read_baton (see above).
531
   Use POOL for for any temporary allocation.
532
*/
533
svn_error_t *dav_svn_authz_read(svn_boolean_t *allowed,
534
                                svn_fs_root_t *root,
535
                                const char *path,
536
                                void *baton,
537
                                apr_pool_t *pool);
538
539
540
509
#ifdef __cplusplus
541
#ifdef __cplusplus
510
}
542
}
511
#endif /* __cplusplus */
543
#endif /* __cplusplus */

Return to bug 60610