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

RE: Bug with bad characters in past versions when doing sparse checkout

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 09 Feb 2009 22:13:59 +0000

On Fri, 2009-02-06 at 14:06 +0100, Bert Huijben wrote:
> > -----Original Message-----
> > From: Julian Foad [mailto:julianfoad_at_btopenworld.com]
> > Sent: vrijdag 6 februari 2009 12:49
> > To: Edward Ned Harvey
> > Cc: dev_at_subversion.tigris.org
> > Subject: RE: Bug with bad characters in past versions when doing sparse
> > checkout
> >
> > Edward Ned Harvey wrote:
> > > This is the right way to submit a bug, right?
> > >
> > > I didn’t see any reply …
> >
> > Yes, this is the right way. Thanks for your patience. Sometimes it
> > takes
> > a bit of prodding to get somebody interested in helping.
> >
> > > This is a reproducible bug, which isn’t super horrible (no data loss
> > > or security risks) and probably doesn’t affect an enormous number of
> > > users, but I know it came up for my users the hard way…
> > >
> > >
> > > From: Harvey, Edward
> > > Sent: Friday, January 30, 2009 4:26 PM
> > > To: dev_at_subversion.tigris.org
> > > Subject: Bug with bad characters in past versions when doing sparse
> > > checkout
> > >
> > > This thread started on tortoisesvn, here:
> > >
> > > http://groups.google.com/group/tortoisesvn-dev/t/ba504f8a58b303d3
> > >
> > > It was found to be a svn bug, not tortoise. So I recreated it on the
> > > command line (with collabnet svn 1.5.5 I just downloaded a minute
> > ago)
> > > and wrote down exactly how to reproduce it. Please see attachments:
> > >
> > > prep_for_problem.txt
> > >
> > > and
> > >
> > > witness_problem.txt
> >
> > I've re-attached these, and also a Unix shell script that runs through
> > the same scenario. But, on my SuSE system, the script does not
> > reproduce
> > the problem that you see on Windows.
>
> On Windows you can't create files with <>|\/:*? characters in their
> names. (Most characters are just forbidden the : is actually the
> filestream separator when it is used at the end of a path).
>
> This error "The filename, directory name, or volume label syntax is
> incorrect" is one of the default error messages you can get when you
> try to use an invalid name.

Ah, yes, I know that, but I sort of failed to think about it!

I can now replicate it on Unix, by applying this artificial check inside
io_check_path():

[[[
  /* ### Replicate on Unix this bug that occurs on Windows:
   * <http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1112186>. */
  if (strpbrk(path, "<>|\\:*?") != NULL)
    {
      svn_error_t *err = svn_error_createf(SVN_ERR_BAD_FILENAME, NULL,
                             _("Can't check path '%s': ### DEBUGGING ###"),
                             svn_path_local_style(path, pool));
      svn_error_clear(err);
    }
]]]

(I don't want Subversion to return an error there, because I'm testing
with RA-local and the server side calls this check as well, and I need
the server side to continue without throwing an error.)

When I set a break point on this code, I can see where it wrongly looks
for that intermediate path.

[[[
#0 io_check_path (path=0x80d7bf0 "dir1/file1(with|bad)chars", resolve_symlinks=0, is_special_p=0xbfdaa3b4,
    kind=0xbfdaa3f8, pool=0x80d99b8) at subversion/libsvn_subr/io.c:144
#1 0xb7de637d in svn_io_check_path (path=0x80d7bf0 "dir1/file1(with|bad)chars", kind=0xbfdaa3f8, pool=0x80d99b8)
    at subversion/libsvn_subr/io.c:282
#2 0xb7f8dc3e in locate_copyfrom (copyfrom_path=0x80e1290 "/dir1/file1(with|bad)chars", copyfrom_rev=2,
    dest_dir=0x80cc778 "dir1", dest_entry=0x80a44b0, return_path=0xbfdaa4b0, return_entry=0xbfdaa4ac,
    return_access=0xbfdaa4b4, pool=0x80d79b0) at subversion/libsvn_wc/update_editor.c:2875
#3 0xb7f8e013 in add_file_with_history (path=0x80d19d0 "dir1/normalname-again", parent_baton=0x80cc738,
    copyfrom_path=0x80e1290 "/dir1/file1(with|bad)chars", copyfrom_rev=2, file_baton=0x80e134c, pool=0x80d1998)
    at subversion/libsvn_wc/update_editor.c:3016
#4 0xb7f8b657 in add_file (path=0x80d19d0 "dir1/normalname-again", parent_baton=0x80cc738,
    copyfrom_path=0x80e1290 "/dir1/file1(with|bad)chars", copyfrom_rev=2, pool=0x80d1998, file_baton=0x80e134c)
    at subversion/libsvn_wc/update_editor.c:1786
#5 0xb7e12077 in add_file (path=0x80d19d0 "dir1/normalname-again", parent_baton=0x80cc730,
    copyfrom_path=0x80e1290 "/dir1/file1(with|bad)chars", copyfrom_revision=2, pool=0x80d1998, file_baton=0x80e1344)
    at subversion/libsvn_delta/cancel.c:166
#6 0xb7e12077 in add_file (path=0x80d19d0 "dir1/normalname-again", parent_baton=0x80cc728,
    copyfrom_path=0x80e1290 "/dir1/file1(with|bad)chars", copyfrom_revision=2, pool=0x80d1998, file_baton=0xbfdaa6a4)
    at subversion/libsvn_delta/cancel.c:166
#7 0xb7f254d2 in add_file_smartly (b=0x80ae6a0, path=0x80d19d0 "dir1/normalname-again", parent_baton=0x80cc728,
    o_path=0x80d19e8 "/dir1/normalname-again", new_file_baton=0xbfdaa6a4, copyfrom_path=0xbfdaa688,
    copyfrom_rev=0xbfdaa68c, pool=0x80d1998) at subversion/libsvn_repos/reporter.c:704
#8 0xb7f25b57 in update_entry (b=0x80ae6a0, s_rev=3, s_path=0x0, s_entry=0x0,
    t_path=0x80d19e8 "/dir1/normalname-again", t_entry=0x80d40d0, dir_baton=0x80cc728,
    e_path=0x80d19d0 "dir1/normalname-again", info=0x0, wc_depth=svn_depth_empty, requested_depth=svn_depth_infinity,
    pool=0x80d1998) at subversion/libsvn_repos/reporter.c:855
#9 0xb7f26483 in delta_dirs (b=0x80ae6a0, s_rev=3, s_path=0x80b8558 "/dir1", t_path=0x80ae708 "/dir1",
    dir_baton=0x80cc728, e_path=0x80ae700 "dir1", start_empty=0, wc_depth=svn_depth_empty,
    requested_depth=svn_depth_infinity, pool=0x80a4248) at subversion/libsvn_repos/reporter.c:1110
#10 0xb7f25a14 in update_entry (b=0x80ae6a0, s_rev=3, s_path=0x80b8558 "/dir1", s_entry=0x80cc5a0,
    t_path=0x80ae708 "/dir1", t_entry=0x80c8590, dir_baton=0x80c8718, e_path=0x80ae700 "dir1", info=0x80b22c8,
    wc_depth=svn_depth_empty, requested_depth=svn_depth_infinity, pool=0x80a4248)
    at subversion/libsvn_repos/reporter.c:837
#11 0xb7f268ef in drive (b=0x80ae6a0, s_rev=3, info=0x80b22c8, pool=0x80a4248)
    at subversion/libsvn_repos/reporter.c:1178
#12 0xb7f26c71 in finish_report (b=0x80ae6a0, pool=0x80a4248) at subversion/libsvn_repos/reporter.c:1242
#13 0xb7f271b9 in svn_repos_finish_report (baton=0x80ae6a0, pool=0x80a4248) at subversion/libsvn_repos/reporter.c:1361
#14 0xb7f39702 in reporter_finish_report (reporter_baton=0x80b2278, pool=0x80a4248)
    at subversion/libsvn_ra_local/ra_plugin.c:210
#15 0xb7f5a2d0 in svn_wc_crawl_revisions3 (path=0x80a27c8 "dir1", adm_access=0x80a4418, reporter=0xb7f3d020,
    report_baton=0x80b2278, restore_files=1, depth=svn_depth_infinity, depth_compatibility_trick=0,
    use_commit_times=0, notify_func=0x8058b24 <notify>, notify_baton=0x80a27d8, traversal_info=0x80a4280,
    pool=0x80a4248) at subversion/libsvn_wc/adm_crawler.c:672
#16 0xb7fd356d in svn_client__update_internal (result_rev=0xbfdaacc8, path=0x80a27c8 "dir1", revision=0xbfdaae6c,
    depth=svn_depth_infinity, depth_is_sticky=1, ignore_externals=0, allow_unver_obstructions=0,
    timestamp_sleep=0xbfdaaccc, send_copyfrom_args=1, ctx=0x807f600, pool=0x80a4248)
    at subversion/libsvn_client/update.c:238
#17 0xb7fd37d9 in svn_client_update3 (result_revs=0x0, paths=0x80a2718, revision=0xbfdaae6c, depth=svn_depth_infinity,
    depth_is_sticky=1, ignore_externals=0, allow_unver_obstructions=0, ctx=0x807f600, pool=0x807ec00)
    at subversion/libsvn_client/update.c:319
#18 0x0805ee71 in svn_cl__update (os=0x807eda0, baton=0xbfdaae58, pool=0x807ec00) at subversion/svn/update-cmd.c:83
#19 0x08057706 in main (argc=5, argv=0xbfdab074) at subversion/svn/main.c:2025
]]]

Maybe someone will spot the problem in there.

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1130717
Received on 2009-02-09 23:14:33 CET

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.