[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Issue #2748: non-UTF-8 filenames in the repository

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Wed, 17 Sep 2008 10:44:52 -0400

Daniel Shahaf wrote:
> C. Michael Pilato wrote on Wed, 17 Sep 2008 at 10:12 -0400:
>> Daniel Shahaf wrote:
>>> Patch for issue #2748 ("clients can create non UTF-8 filenames in the
>>> repository"). It prevents non-UTF-8 paths from entering the repository,
>>> but it doesn't affect existing files in existing repositories, svnsync,
>>> or 'svnadmin load'.
>>> I'm running 'make check' now, and I'll commit later today or tomorrow if
>>> I don't hear anything.
>>> Daniel
>>> [[[
>>> Validate in libsvn_repos that paths added to the repository are valid UTF-8.
>>> This fixes issue #2748.
>> These validations (which are a good idea) belong in the lowest layer that
>> dictates the requirement, in this case, the FS layer.
> I hadn't noticed that requirement in FS (but found it now, in svn_fs.h).
> I'll move the checks -- they should still affect only new files/directories,
> as far as I can tell. (And I'll also fix the comments in svn_fs.h to say
> explicitly that control characters aren't allowed; svn_path_check_valid()
> already forbids them.)

Hrm... control characters *are* allowed, though. What you see in svn_fs.h
is the full set of requirements *by the FS layer* for its paths. UTF-8 with
no 0-offset characters. That's the whole story. To add control characters
to the blacklist now is a violation of the API contract. If that means that
svn_path_check_valid() isn't the right function to use for this validation
-- or that it needs a new boolean flag that toggles the checks for control
characters -- so be it.

C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2008-09-17 16:53:27 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.