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

Re: Bug: IP address bogusly interpreted as peg revision

From: Troy Curtis Jr <troycurtisjr_at_gmail.com>
Date: Tue, 27 May 2008 10:36:28 -0500

On Mon, May 26, 2008 at 11:38 PM, Karl Fogel <kfogel_at_red-bean.com> wrote:
> "Troy Curtis Jr" <troycurtisjr_at_gmail.com> writes:
>> This isn't really a change in our specification at the APIs, just in how we
>> interpret the user specified args. It is probably valid for a user to believe
>> a trailing slash should tell Subversion that the characters before it are a
>> target and NOT a peg revision, despite any '@' symbols that may be in it.
>
> I think r31458 made this happen, right? Does this mean that the "just
> add a trailing slash to the IP address" workaround now actually works?
>
> -K
>

Nope. This issue isn't that it gets parsed incorrectly when the args
are canonicalized, the issue is that it gets parsed incorrectly when
the previously canonicalized string is used by whatever function is
actually doing the work (update, commit, etc). Part of
canonicalization is removing the trailing slash. So by the time it
gets to the function doing the work, the trailing slash is no longer
present to signal to the peg parsing to stop looking for a peg.

So

User Input: svn+ssh://svn@10.0.1.1/
After svn_client_args_to_target_array(): svn+ssh://svn@10.0.1.1
Now this is passed to svn_opt_parse_path() to actually 'parse' the peg
revision (and return it in a svn_opt_revision_t structure). But of
course it will now think 10.0.1.1 is the peg revision.

So still the only valid escaping method is a trailing '@'. Just for
confirmation I tried it on my wife's computer using 1.4.6:

<test>
holly[~]$ svn --version
svn, version 1.4.6 (r28521)
   compiled Mar 30 2008, 19:51:11

Copyright (C) 2000-2007 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

holly[~]$ svn ls svn+ssh://svn@10.0.1.1
svn: Syntax error parsing revision '10.0.1.1'
holly[~]$ svn ls svn+ssh://svn@10.0.1.1/
svn: Syntax error parsing revision '10.0.1.1'
holly[~]$ svn ls svn+ssh://svn@10.0.1.1/@
[Here I hit Ctrl-C after a pause...]
svn: Connection closed unexpectedly
holly[~]$
</test>

After re-reading the OP I'm not actually sure what he is saying is
really different between 1.5 and 1.4. They both try to parse 10.0.1.1
as a peg revision and print an error. 1.5 also suggests that he check
'svn help' for usage.

Troy

-- 
"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-05-27 17:36:40 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.