subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1453491 - /subversion/branches/1.7.x-issue4332/subversion/libsvn_ra_neon/props.c
Date Wed, 06 Mar 2013 19:18:52 GMT
Author: cmpilato
Date: Wed Mar  6 19:18:51 2013
New Revision: 1453491

URL: http://svn.apache.org/r1453491
Log:
On the '1.7.x-issue4332' branch: Fix issue #4332 ("neon OPTIONS
request on repository root causes authz access denied").

* subversion/libsvn_ra_neon/props.c
  (svn_ra_neon__do_check_path): When checking a patch against an
    invalid revision number (that is, HEAD), query its public URL rather
    than trying to resolve HEAD into a fixed revision number and then
    querying the baseline URL for the path in that revision.

Modified:
    subversion/branches/1.7.x-issue4332/subversion/libsvn_ra_neon/props.c

Modified: subversion/branches/1.7.x-issue4332/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-issue4332/subversion/libsvn_ra_neon/props.c?rev=1453491&r1=1453490&r2=1453491&view=diff
==============================================================================
--- subversion/branches/1.7.x-issue4332/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/1.7.x-issue4332/subversion/libsvn_ra_neon/props.c Wed Mar  6 19:18:51
2013
@@ -1313,9 +1313,7 @@ svn_ra_neon__do_check_path(svn_ra_sessio
 {
   svn_ra_neon__session_t *ras = session->priv;
   const char *url = ras->url->data;
-  const char *bc_url;
-  const char *bc_relative;
-  svn_error_t *err;
+  svn_error_t *err = SVN_NO_ERROR;
   svn_boolean_t is_dir;
 
   /* ### For now, using svn_ra_neon__get_starting_props() works because
@@ -1350,18 +1348,25 @@ svn_ra_neon__do_check_path(svn_ra_sessio
   if (path)
     url = svn_path_url_add_component2(url, path, pool);
 
-  err = svn_ra_neon__get_baseline_info(&bc_url, &bc_relative, NULL, ras,
-                                       url, revision, pool);
+  /* If we're querying HEAD, we can do so against the public URL;
+     otherwise, we have to get a revision-specific URL to work with.  */
+  if (SVN_IS_VALID_REVNUM(revision))
+    {
+      const char *bc_url;
+      const char *bc_relative;
+
+      err = svn_ra_neon__get_baseline_info(&bc_url, &bc_relative, NULL, ras,
+                                           url, revision, pool);
+      if (! err)
+        url = svn_path_url_add_component2(bc_url, bc_relative, pool);
+    }
 
   if (! err)
     {
       svn_ra_neon__resource_t *rsrc;
-      const char *full_bc_url = svn_path_url_add_component2(bc_url,
-                                                            bc_relative,
-                                                            pool);
-
-      /* query the DAV:resourcetype of the full, assembled URL. */
-      err = svn_ra_neon__get_starting_props(&rsrc, ras, full_bc_url, pool);
+          
+      /* Query the DAV:resourcetype.  */
+      err = svn_ra_neon__get_starting_props(&rsrc, ras, url, pool);
       if (! err)
         is_dir = rsrc->is_collection;
     }



Mime
View raw message