You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/11/28 07:47:02 UTC

svn commit: r1414545 - /subversion/branches/in-repo-authz/subversion/mod_authz_svn/mod_authz_svn.c

Author: breser
Date: Wed Nov 28 06:47:01 2012
New Revision: 1414545

URL: http://svn.apache.org/viewvc?rev=1414545&view=rev
Log:
On in-authz_repo branch: Switch mod_authz_svn to using svn_repos_authz_read2()

* subversion/mod_authz_svn/mod_authz_svn.c
  (AuthzSVNAccessFile_cmd): Don't adjust the path relative to server root when
    path is a url.
  (get_access_conf): Always generate the repos_path.  In the case of a repo
    relative access file avoid adding the conf root if the path is a url.
    Use svn_repos_authz_read2() instead of svn_repos_authz_read().

Modified:
    subversion/branches/in-repo-authz/subversion/mod_authz_svn/mod_authz_svn.c

Modified: subversion/branches/in-repo-authz/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_authz_svn/mod_authz_svn.c?rev=1414545&r1=1414544&r2=1414545&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/in-repo-authz/subversion/mod_authz_svn/mod_authz_svn.c Wed Nov 28 06:47:01 2012
@@ -96,7 +96,10 @@ AuthzSVNAccessFile_cmd(cmd_parms *cmd, v
     return "AuthzSVNAccessFile and AuthzSVNReposRelativeAccessFile "
            "directives are mutually exclusive.";
 
-  conf->access_file = ap_server_root_relative(cmd->pool, arg1);
+  if (svn_path_is_repos_relative_url(arg1) || svn_path_is_url(arg1))
+    conf->access_file = arg1;
+  else
+    conf->access_file = ap_server_root_relative(cmd->pool, arg1);
 
   return NULL;
 }
@@ -177,16 +180,23 @@ get_access_conf(request_rec *r, authz_sv
   dav_error *dav_err;
   char errbuf[256];
 
+  dav_err = dav_svn_get_repos_path(r, conf->base_path, &repos_path);
+  if (dav_err)
+    {
+      ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "%s", dav_err->desc);
+      return NULL;
+    }
+
   if (conf->repo_relative_access_file)
     {
-      dav_err = dav_svn_get_repos_path(r, conf->base_path, &repos_path);
-      if (dav_err) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "%s", dav_err->desc);
-        return NULL;
-      }
-      access_file = svn_dirent_join_many(scratch_pool, repos_path, "conf",
-                                         conf->repo_relative_access_file,
-                                         NULL);
+      access_file = conf->repo_relative_access_file;
+      if (!svn_path_is_repos_relative_url(access_file) &&
+          !svn_path_is_url(access_file))
+        {
+          access_file = svn_dirent_join_many(scratch_pool, repos_path, "conf",
+                                             conf->repo_relative_access_file,
+                                             NULL);
+        }
     }
   else
     {
@@ -202,8 +212,8 @@ get_access_conf(request_rec *r, authz_sv
   access_conf = user_data;
   if (access_conf == NULL)
     {
-      svn_err = svn_repos_authz_read(&access_conf, access_file,
-                                     TRUE, r->connection->pool);
+      svn_err = svn_repos_authz_read2(&access_conf, access_file,
+                                      TRUE, repos_path, r->connection->pool);
       if (svn_err)
         {
           ap_log_rerror(APLOG_MARK, APLOG_ERR,