Daniel Shahaf wrote on Sat, Jun 11, 2011 at 00:01:18 +0300: > s...@apache.org wrote on Tue, May 31, 2011 at 12:23:05 -0000: > > Author: stsp > > Date: Tue May 31 12:23:05 2011 > > New Revision: 1129641 > > > > URL: http://svn.apache.org/viewvc?rev=1129641&view=rev > > Log: > > Make 'svnadmin verify' error out if an invalid path is found in the > > repository. > > > > There have been reports of non-UTF-8 paths having entered repositories, > > probably due to buggy third-party clients running against pre-1.6 servers > > (pre-1.6 servers do not verify filename encoding). > > See this thread for one such report, which also mentions that > > 'svnadmin verify' didn't detect this problem: > > http://svn.haxx.se/users/archive-2011-05/0361.shtml > > > > * subversion/include/private/svn_fs_util.h > > (svn_fs__path_valid): Declare. > > > > * subversion/libsvn_fs/fs-loader.c > > (path_valid): Rename this funcion to ... > > (svn_fs__path_valid): ... this, making it available to the repos layer. > > (svn_fs_make_dir, svn_fs_copy, svn_fs_make_file): Update callers. > > > > * subversion/tests/cmdline/svnadmin_tests.py > > (verify_non_utf8_paths): New test which makes sure that 'svnadmin verify' > > will error out on non-UTF-8 paths. It also makes sure that the repository > > can still be dumped successfully so that the problem can be fixed by > > editing the dumpfile. This test is FSFS-only for now but that shouldn't > > be a problem. > > > > * subversion/libsvn_repos/dump.c > > (dump_node): If verifying, run the node's path through > > svn_fs__path_valid(). > > > > Modified: > > subversion/trunk/subversion/include/private/svn_fs_util.h > > subversion/trunk/subversion/libsvn_fs/fs-loader.c > > subversion/trunk/subversion/libsvn_repos/dump.c > > subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py > > > > Modified: subversion/trunk/subversion/libsvn_repos/dump.c > > URL: > > http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1129641&r1=1129640&r2=1129641&view=diff > > ============================================================================== > > --- subversion/trunk/subversion/libsvn_repos/dump.c (original) > > +++ subversion/trunk/subversion/libsvn_repos/dump.c Tue May 31 12:23:05 2011 > > @@ -36,6 +36,7 @@ > > #include "svn_props.h" > > > > #include "private/svn_mergeinfo_private.h" > > +#include "private/svn_fs_util.h" > > > > #define ARE_VALID_COPY_ARGS(p,r) ((p) && SVN_IS_VALID_REVNUM(r)) > > > > @@ -242,6 +243,10 @@ dump_node(struct edit_baton *eb, > > svn_fs_root_t *compare_root = NULL; > > apr_file_t *delta_file = NULL; > > > > + /* If we're verifying, validate the path. */ > > + if (eb->verify) > > + SVN_ERR(svn_fs__path_valid(path, pool)); > > + > > Can we print a warning to stderr if eb->verify == FALSE ? > > (we have a notify_func we can use) >
r1134484 (and predecessors). > > > /* Write out metadata headers for this file node. */ > > SVN_ERR(svn_stream_printf(eb->stream, pool, > > SVN_REPOS_DUMPFILE_NODE_PATH ": %s\n", > >