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

Re: [PATCH] issue #2224- copy wc path to itself recurses infinitely

From: John Szakmeister <john_at_szakmeister.net>
Date: 2005-04-15 00:45:23 CEST

On Thursday 14 April 2005 04:06, Alexander wrote:
> Sorry, re-sending due to missing log message and issues with the test
> case.
> There are a couple of issues. One is about the test case - how to kill
> a long-running process from Python in both *nix and Windows? The second
> is the error code - SVN_ERR_UNSUPPORTED_FEATURE is not as good as
> SVN_ERR_INVALID_ARGUMENTS, but that does not exist.
> The issue is here:
> http://subversion.tigris.org/issues/show_bug.cgi?id=2224
> +      if (src_is_url == dst_is_url)
> +        {
> +          if (strcmp (src_path, dst_path) == 0)
> +            return svn_error_createf
> +               _("Cannot copy path '%s' into itself"),
> +               svn_path_local_style (src_path, pool));
> +        }

I'm not sure the above is entirely correct. First, svn_path_local_style()
only meant to be called on strings that represent local filesystem paths.
At this point src_path could be a URL or wc path. Secondly, this only
covers two cases: wc-to-wc copies, and url-to-url copies. It doesn't
prevent someone from doing a wc-to-url or a url-to-wc copy into itself.
I think if we're going to say that you can't copy a directory into
itself, then we should do this for all cases.

> +  for dirname in dnames:
> +    dir_path = os.path.join(sbox.wc_dir, dirname)
> +
> +    # try to copy dir to itself
> +    ## TODO need to kill the process after a couple of seconds
> +    ## to prevent infinite wait

I don't think you need to worry about killing the process... it's going to
die from a lack of handles, or it's going to exceed the maximum path.
Someone else might feel differently about that though.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Apr 15 01:39:31 2005

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