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

Re: Issue 1954

From: Philipp Marek <philipp_at_marek.priv.at>
Date: 2006-07-14 17:46:22 CEST

On Thursday 13 July 2006 19:00 C. Michael Pilato wrote:
> Philipp Marek wrote:
> > current status:
> >>Yes, let's ban control characters from SVN filenames.
> >
> > And there's a svn_path_check_valid since r12???, so I believe that's the
> > current policy.
> >
> > I'm asking because I need a way to encode *any* filename for fsvs
> > (especially with \t, as that's a often used special character), so I'd
> > like to ask if there's some news regarding issue 1954.
>
> Forgive my ignorance, but is fsvs using the client/working copy libraries?
> Because these restrictions on path names are implemented on the Subversion
> client side, *not* in the repository (which more or less allows any UTF-8
> path).
The client libraries yes; the wc I believe it doesn't.
ldd reports libsvn_wc as being used, but objdump shows no functions being used:
        $ objdump -t fsvs | grep svn
        00000000 F *UND* 00000062 svn_stream_read
        00000000 F *UND* 0000000e svn_stream_set_write
        00000000 F *UND* 0000000e svn_stream_set_close
        00000000 F *UND* 00000062 svn_stream_write
        00000000 F *UND* 000000a7 svn_strerror
        00000000 F *UND* 000002c2 svn_time_from_cstring
        00000000 F *UND* 00000099 svn_stream_from_aprfile
        00000000 F *UND* 0000004f svn_error_create
        00000000 F *UND* 0000000e svn_stream_set_read
        00000000 F *UND* 00000022 svn_error__locate
        00000000 F *UND* 0000007d svn_time_to_cstring
        00000000 F *UND* 000000a8 svn_ra_open
        00000000 F *UND* 0000004b svn_ra_do_update
        00000000 F *UND* 000000f5 svn_txdelta_apply
        00000000 F *UND* 000000a8 svn_txdelta_send_stream
        00000000 F *UND* 00000040 svn_client_get_username_provider
        00000000 F *UND* 00000040 svn_client_get_simple_provider
        00000000 F *UND* 0000004b svn_ra_do_status
        00000000 F *UND* 00000007 svn_ra_initialize
        00000000 F *UND* 0000004b svn_ra_get_commit_editor
        00000000 F *UND* 00000034 svn_string_createf
        00000000 F *UND* 00000046 svn_stream_create
        00000000 F *UND* 0000001b svn_stream_close
        00000000 F *UND* 00000099 svn_stream_from_stringbuf
        00000000 F *UND* 00000021 svn_ra_get_latest_revnum
        00000000 F *UND* 0000003f svn_string_create
        00000000 F *UND* 0000014f svn_auth_open
        00000000 F *UND* 0000003f svn_stringbuf_create

I don't think it uses libsvn_wc functions (at least directly):
        $ strings fsvs | grep svn
        libsvn_subr-1.so.0
        libsvn_ra-1.so.0
        libsvn_client-1.so.0
        svn_strerror
        svn_ra_initialize
        svn_stream_read
        svn_error__locate
        svn_error_create
        svn_stream_write
        svn_stream_close
        svn_stream_create
        svn_stream_set_read
        svn_stream_set_write
        svn_stream_set_close
        svn_string_createf
        svn_time_to_cstring
        svn_string_create
        svn_stringbuf_create
        svn_stream_from_aprfile
        svn_stream_from_stringbuf
        svn_txdelta_send_stream
        svn_ra_open
        svn_ra_get_commit_editor
        svn_ra_get_latest_revnum
        svn_ra_do_update
        svn_client_get_simple_provider
        svn_client_get_username_provider
        svn_auth_open
        svn_ra_do_status
        svn_txdelta_apply
        svn_time_from_cstring
        libsvn_delta-1.so.0
        svn_ra_initialize: %s
        svn_stream_read: %s
        svn_stream_write: %s
        svn_stream_close: %s
        svn_txdelta_send_stream: %s
        svn_ra_open: %s
        svn_ra_get_commit_editor: %s
        svn_ra_get_latest_revnum: %s
        svn_ra_do_update: %s
        svn_ra_do_status: %s
        svn:entry
        svn:text-time
        svn:owner
        svn:group
        svn:unix-mode
        svn:special

And in subversion/libsvn_fs/fs-loader.c I see this function:
        svn_error_t *
        svn_fs_make_file(svn_fs_root_t *root, const char *path, apr_pool_t *pool)
        {
          SVN_ERR(svn_path_check_valid(path, pool));
          return root->vtable->make_file(root, path, pool);
        }
which makes me believe that this should happen for the repository, too.

A quick test confirms this: (sorry about the german messages, but I
believe they are readable enough):
        $ svnadmin dump ///tmp/t/ > /tmp/dump
        * Ausgegeben Revision 0.
        * Ausgegeben Revision 1.
        /tmp/z$ vi /tmp/dump
Renaming the file in the dump to have a tab ...
        /tmp/z$ svnadmin load ///tmp/t/ > /tmp/dump
        /tmp/z$ svnadmin create /tmp/t2
        /tmp/z$ svnadmin create /tmp/t2
        /tmp/z$ svnadmin load /tmp/t2 < /tmp/dump
        <<< Neue Transaktion basierend auf Originalrevision 1 gestartet
        svnadmin: Ungültiges Steuerzeichen '0x09' in Pfad 'x as'
             * Füge Pfad hinzu : x as .../tmp/z$
        /tmp/z$ svn ls file:///tmp/t2
        /tmp/z$ svnlook youngest //tmp/t2
        0
        /tmp/z$

So even dumps with such filenames cannot be used. I didn't manage to get
a valid URL, but that may be just my ignorance.
        /tmp/z$ svn mv file:///tmp/t/x "file:///tmp/t/tab file"
        svn: URL 'file:///tmp/t/tab file' ist nicht korrekt URI-kodiert
        /tmp/z$ svn mv file:///tmp/t/x "file:///tmp/t/tab&#09;file"
        svn: URL 'file:///tmp/t/tab&#09;file' ist nicht korrekt URI-kodiert

Now, is that a big mis-understanding (and mis-use of the interfaces) on my
side, or is it really so that subversion doesn't allow special characters?
And if it doesn't, may I ask for opinions about my various ideas?

Thank you in advance.

Regards,

Phil

-- 
Versioning your /etc, /home or even your whole installation?
             Try fsvs (fsvs.tigris.org)!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 14 17:47:10 2006

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.