subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1448820 - in /subversion/trunk/subversion: libsvn_fs_fs/tree.c libsvn_fs_util/fs-util.c
Date Thu, 21 Feb 2013 21:54:37 GMT
Author: stefan2
Date: Thu Feb 21 21:54:36 2013
New Revision: 1448820

URL: http://svn.apache.org/r1448820
Log:
Follow-up to 1448810: fix canonicalization check for paths containing
a single character and update two indirect callers of open_path.

* subversion/libsvn_fs_fs/tree.c
  (fs_copy,
   fs_revision_link): ensure canonical path parameters

* subversion/libsvn_fs_util/fs-util.c
  (is_canonical_abspath): fix canonicalization check for single-char paths

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/tree.c
    subversion/trunk/subversion/libsvn_fs_util/fs-util.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1448820&r1=1448819&r2=1448820&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Thu Feb 21 21:54:36 2013
@@ -2444,7 +2444,12 @@ fs_copy(svn_fs_root_t *from_root,
         const char *to_path,
         apr_pool_t *pool)
 {
-  return svn_error_trace(copy_helper(from_root, from_path, to_root, to_path,
+  return svn_error_trace(copy_helper(from_root,
+                                     svn_fs__canonicalize_abspath(from_path,
+                                                                  pool),
+                                     to_root,
+                                     svn_fs__canonicalize_abspath(to_path,
+                                                                  pool),
                                      TRUE, pool));
 }
 
@@ -2461,6 +2466,7 @@ fs_revision_link(svn_fs_root_t *from_roo
   if (! to_root->is_txn_root)
     return SVN_FS__NOT_TXN(to_root);
 
+  path = svn_fs__canonicalize_abspath(path, pool);
   return svn_error_trace(copy_helper(from_root, path, to_root, path,
                                      FALSE, pool));
 }

Modified: subversion/trunk/subversion/libsvn_fs_util/fs-util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_util/fs-util.c?rev=1448820&r1=1448819&r2=1448820&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_util/fs-util.c (original)
+++ subversion/trunk/subversion/libsvn_fs_util/fs-util.c Thu Feb 21 21:54:36 2013
@@ -35,8 +35,8 @@
 #include "private/svn_fspath.h"
 #include "../libsvn_fs/fs-loader.h"
 
-/* Return TRUE, if PATH (already known to start with a '/') of PATH_LEN
- * chars does not end with a '/' and does not contain duplicate '/'.
+/* Return TRUE, if PATH of PATH_LEN > 0 chars does not end with a '/' and
+ * does not contain duplicate '/'.
  */
 static svn_boolean_t
 is_canonical_abspath(const char *path, size_t path_len)
@@ -44,6 +44,10 @@ is_canonical_abspath(const char *path, s
   const char *end;
 
   /* check for trailing '/' */
+  if (path[0] != '/')
+    return FALSE;
+
+  /* check for trailing '/' */
   if (path_len == 1)
     return TRUE;
   if (path[path_len - 1] == '/')



Mime
View raw message