subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1540941 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_subr/dirent_uri.c subversion/tests/libsvn_subr/dirent_uri-test.c
Date Tue, 12 Nov 2013 04:02:43 GMT
Author: svn-role
Date: Tue Nov 12 04:02:42 2013
New Revision: 1540941

URL: http://svn.apache.org/r1540941
Log:
Merge r1516806 from trunk:

 * r1516806
   Do not look at the hostname part of an URI when checking that
   the schema data is canonical.
   Justification:
     As reported on dev@, "svn co file://./" and similar commands abort
     instead of returning an error that the URL is invalid.  This was
     caused by svn_uri_is_canonical treating the hostname "." as a path
     segment.  After this change, svn_uri_is_canonicall correctly
     determines that the URL is (syntactically) canonical, and the
     commands later fail with a normal error in the RA layer, which
     validates the semantics of the hostname.
   Votes:
     +1: brane, stefan2, philip

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/libsvn_subr/dirent_uri.c
    subversion/branches/1.7.x/subversion/tests/libsvn_subr/dirent_uri-test.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1516806

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1540941&r1=1540940&r2=1540941&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Tue Nov 12 04:02:42 2013
@@ -116,17 +116,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1516806
-   Do not look at the hostname part of an URI when checking that
-   the schema data is canonical.
-   Justification:
-     As reported on dev@, "svn co file://./" and similar commands abort
-     instead of returning an error that the URL is invalid.  This was
-     caused by svn_uri_is_canonical treating the hostname "." as a path
-     segment.  After this change, svn_uri_is_canonicall correctly
-     determines that the URL is (syntactically) canonical, and the
-     commands later fail with a normal error in the RA layer, which
-     validates the semantics of the hostname.
-   Votes:
-     +1: brane, stefan2, philip

Modified: subversion/branches/1.7.x/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_subr/dirent_uri.c?rev=1540941&r1=1540940&r2=1540941&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_subr/dirent_uri.c Tue Nov 12 04:02:42 2013
@@ -1866,6 +1866,9 @@ svn_uri_is_canonical(const char *uri, ap
 #endif /* SVN_USE_DOS_PATHS */
 
   /* Now validate the rest of the URI. */
+  seg = ptr;
+  while (*ptr && (*ptr != '/'))
+    ptr++;
   while(1)
     {
       apr_size_t seglen = ptr - seg;
@@ -1884,9 +1887,8 @@ svn_uri_is_canonical(const char *uri, ap
 
       if (*ptr == '/')
         ptr++;
-      seg = ptr;
-
 
+      seg = ptr;
       while (*ptr && (*ptr != '/'))
         ptr++;
     }

Modified: subversion/branches/1.7.x/subversion/tests/libsvn_subr/dirent_uri-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/tests/libsvn_subr/dirent_uri-test.c?rev=1540941&r1=1540940&r2=1540941&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/tests/libsvn_subr/dirent_uri-test.c (original)
+++ subversion/branches/1.7.x/subversion/tests/libsvn_subr/dirent_uri-test.c Tue Nov 12 04:02:42
2013
@@ -891,6 +891,9 @@ static const testcase_canonicalize_t uri
     { "file:///c:/temp/REPOS", "file:///c:/temp/REPOS" },
     { "file:///C:/temp/REPOS", "file:///C:/temp/REPOS" },
 #endif /* SVN_USE_DOS_PATHS */
+    /* Hostnames that look like non-canonical paths */
+    { "file://./foo",             "file://./foo" },
+    { "http://./foo",             "http://./foo" },
   /* svn_uri_is_canonical() was a private function in the 1.6 API, and
      has since taken a MAJOR change of direction, namely that only
      absolute URLs are considered canonical uris now. */



Mime
View raw message