You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joseph Galbraith <ga...@vandyke.com> on 2005/04/20 16:12:38 UTC

SVN strips port from svn+ssh URLs...

I know not all SSH clients support the user@host:port syntax,
but I've one that does, and it would sure be nice if this
didn't get stripped.

Also, it is probably a bug that the :port part of the URL
is silently ignored... at the very least, if it isn't
going to be accepted, it should be rejected with an error
instead of silently discarded.

Thanks,

Joseph

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN strips port from svn+ssh URLs...

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2005-04-21 at 11:47, S.Ramaswamy wrote:
> >
> > It looks like apr_uri_t contains a "hostinfo" field which is exactly
> > what we should be passing to ssh.  No need to reconstruct it case by
> > case.
> >
> Does this fix look like what you had in mind ?

Yeah, looks good (with one tiny nit about the way you declared
"hostinfo").  I'll commit it and nominate it for 1.2.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN strips port from svn+ssh URLs...

Posted by "S.Ramaswamy" <ra...@collab.net>.
>
> It looks like apr_uri_t contains a "hostinfo" field which is exactly
> what we should be passing to ssh.  No need to reconstruct it case by
> case.
>
Does this fix look like what you had in mind ?

Thanks
Ramaswamy

Pass combined user, hostname, and port information to ssh
clients that can handle 'user@host:port' format input.

* subversion/libsvn_ra_svn/client.c
    (find_tunnel_agent) : Replaced user and hostname function
      parameters with hostinfo from apr_uri_t; hostinfo contains
      the combined user, hostname, and port information.
    (ra_svn_open) : Call find_tunnel_agent() with hostinfo
      instead of user and hostname.












Re: SVN strips port from svn+ssh URLs...

Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2005-04-20 at 14:36, Justin Erenkrantz wrote:
> 
> if (uri.user && uri.port) {
>  (*argv)[n++] = apr_psprintf(pool, "%s@%s:%d", uri.user, uri.host, 
> uri.port);
> }
> else if (uri.user) {
>  (*argv)[n++] = apr_psprintf(pool, "%s@%s", uri.user, uri.host);
> }
> else {
>  (*argv)[n++] = uri.host;
> }

It looks like apr_uri_t contains a "hostinfo" field which is exactly
what we should be passing to ssh.  No need to reconstruct it case by
case.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN strips port from svn+ssh URLs...

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Wednesday, April 20, 2005 10:12 AM -0600 Joseph Galbraith 
<ga...@vandyke.com> wrote:

> I know not all SSH clients support the user@host:port syntax,
> but I've one that does, and it would sure be nice if this
> didn't get stripped.
>
> Also, it is probably a bug that the :port part of the URL
> is silently ignored... at the very least, if it isn't
> going to be accepted, it should be rejected with an error
> instead of silently discarded.

In fact, I think find_tunnel_agent() in subversion/libsvn_ra_svn/client.c 
should just take uri not the user and hostname args.  Then, I'd switch the 
following line from:

 (*argv)[n++] = (user) ? apr_psprintf(pool, "%s@%s", user, host) : host;

to:

if (uri.user && uri.port) {
 (*argv)[n++] = apr_psprintf(pool, "%s@%s:%d", uri.user, uri.host, 
uri.port);
}
else if (uri.user) {
 (*argv)[n++] = apr_psprintf(pool, "%s@%s", uri.user, uri.host);
}
else {
 (*argv)[n++] = uri.host;
}

Be nice if someone submitted a proper patch and make sure it works.  ;-)

HTH.  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN strips port from svn+ssh URLs...

Posted by Marcus Rueckert <da...@web.de>.
On 2005-04-20 10:12:38 -0600, Joseph Galbraith wrote:
> Also, it is probably a bug that the :port part of the URL
> is silently ignored... at the very least, if it isn't
> going to be accepted, it should be rejected with an error
> instead of silently discarded.

i agree here. it should error out.

i have 2 workarounds:
tunnels configuration within svn:
  http://svnbook.red-bean.com/en/1.1/ch06s03.html#svn-ch-6-sect-3.4

.ssh/config file
  and setup the port for this host there.

so long

darix

-- 
irssi - the client of the smart and beautiful people

              http://www.irssi.de/


!DSPAM:426682fc84311652152276!



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN strips port from svn+ssh URLs...

Posted by Andrew Thompson <su...@aktzero.com>.
Joseph Galbraith wrote:
> I know not all SSH clients support the user@host:port syntax,
> but I've one that does, and it would sure be nice if this
> didn't get stripped.
> 
> Also, it is probably a bug that the :port part of the URL
> is silently ignored... at the very least, if it isn't
> going to be accepted, it should be rejected with an error
> instead of silently discarded.

Confirmed with 1.1.4.

It's stripped before the call to ssh. :(

-- 
Andrew Thompson
http://aktzero.com/
Interested in a hosted SVN repository? Email me, let's talk...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN strips port from svn+ssh URLs...

Posted by Joseph Galbraith <ga...@vandyke.com>.
John Peacock wrote:
> Joseph Galbraith wrote:
> 
>> I know not all SSH clients support the user@host:port syntax,
>> but I've one that does, and it would sure be nice if this
>> didn't get stripped.
>>
>> Also, it is probably a bug that the :port part of the URL
>> is silently ignored... at the very least, if it isn't
>> going to be accepted, it should be rejected with an error
>> instead of silently discarded.
> 
> 
> I agree (having recently been bitten by this myself).  At the very 
> least, something like the following should be added to the FAQ:
> 
> In order to use a non-standard ssh port or a different user name when 
> connecting with svn+ssh:// you can set the following environment variable:
> 
>     export SVN_SSH='ssh -l youruser -p someport'
> 
> and all subsequent svn+ssh:// connections will use that ssh command line 
> instead of the default.  The user and port information can also be set 
> on a host by host basis using the ssh configuration file.  See 
> ssh_config(5) for more details.

I think (I haven't tried, but the docs say) it can also be
set using the [tunnel] section of the svn config file.

None of which is nearly as convient as specifying it as part
of the URL (if the ssh client supports it.)

Thanks,

Joseph

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: SVN strips port from svn+ssh URLs...

Posted by John Peacock <jp...@rowman.com>.
Joseph Galbraith wrote:
> I know not all SSH clients support the user@host:port syntax,
> but I've one that does, and it would sure be nice if this
> didn't get stripped.
> 
> Also, it is probably a bug that the :port part of the URL
> is silently ignored... at the very least, if it isn't
> going to be accepted, it should be rejected with an error
> instead of silently discarded.

I agree (having recently been bitten by this myself).  At the very 
least, something like the following should be added to the FAQ:

In order to use a non-standard ssh port or a different user name when 
connecting with svn+ssh:// you can set the following environment variable:

	export SVN_SSH='ssh -l youruser -p someport'

and all subsequent svn+ssh:// connections will use that ssh command line 
instead of the default.  The user and port information can also be set 
on a host by host basis using the ssh configuration file.  See 
ssh_config(5) for more details.

HTH

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org