subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1066114 - /subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c
Date Tue, 01 Feb 2011 18:16:07 GMT
Author: cmpilato
Date: Tue Feb  1 18:16:07 2011
New Revision: 1066114

URL: http://svn.apache.org/viewvc?rev=1066114&view=rev
Log:
Update some uses of deprecated path functions to the new
dirent/uri/etc. interfaces.

* subversion/mod_authz_svn/mod_authz_svn.c
  (uri_canonicalize): Remove as unnecessary.
  (create_authz_svn_dir_config): Use svn_urlpath__canonicalize()
    instead of uri_canonicalize().
  (req_check_access): Use svn_urlpath__canonicalize()
    instead of uri_canonicalize(), and svn_fspath__canonicalize()
    instead of svn_path_join().

Modified:
    subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c

Modified: subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c?rev=1066114&r1=1066113&r2=1066114&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/trunk/subversion/mod_authz_svn/mod_authz_svn.c Tue Feb  1 18:16:07 2011
@@ -43,6 +43,7 @@
 #include "svn_string.h"
 #include "svn_repos.h"
 #include "svn_dirent_uri.h"
+#include "private/svn_fspath.h"
 
 
 extern module AP_MODULE_DECLARE_DATA authz_svn_module;
@@ -61,17 +62,6 @@ typedef struct authz_svn_config_rec {
  * Configuration
  */
 
-/*
- * Return a canonicalized version of URI (which is a
- * schema/hostname-less URI), allocated from POOL.
- */
-static const char *
-uri_canonicalize(const char *uri, apr_pool_t *pool)
-{
-  return apr_pstrcat(pool, (uri[0] == '/') ? "/" : "",
-                     svn_relpath_canonicalize(uri, pool), NULL);
-}
-               
 /* Implements the #create_dir_config method of Apache's #module vtable. */
 static void *
 create_authz_svn_dir_config(apr_pool_t *p, char *d)
@@ -80,7 +70,7 @@ create_authz_svn_dir_config(apr_pool_t *
   conf->base_path = d;
 
   if (d)
-    conf->base_path = uri_canonicalize(d, p);
+    conf->base_path = svn_urlpath__canonicalize(d, p);
 
   /* By default keep the fortress secure */
   conf->authoritative = 1;
@@ -325,7 +315,7 @@ req_check_access(request_rec *r,
         break;
     }
 
-  if (strcmp(uri_canonicalize(r->uri, r->pool), conf->base_path) == 0)
+  if (strcmp(svn_urlpath__canonicalize(r->uri, r->pool), conf->base_path) == 0)
     {
       /* Do no access control when conf->base_path(as configured in <Location>)
        * and given uri are same. The reason for such relaxation of access
@@ -367,7 +357,7 @@ req_check_access(request_rec *r,
     repos_path = NULL;
 
   if (repos_path)
-    repos_path = svn_path_join("/", repos_path, r->pool);
+    repos_path = svn_fspath__canonicalize(repos_path, r->pool);
 
   *repos_path_ref = apr_pstrcat(r->pool, repos_name, ":", repos_path,
                                 (char *)NULL);
@@ -415,7 +405,7 @@ req_check_access(request_rec *r,
         }
 
       if (dest_repos_path)
-        dest_repos_path = svn_path_join("/", dest_repos_path, r->pool);
+        dest_repos_path = svn_fspath__canonicalize(dest_repos_path, r->pool);
 
       *dest_repos_path_ref = apr_pstrcat(r->pool, dest_repos_name, ":",
                                          dest_repos_path, (char *)NULL);



Mime
View raw message