Patch multihop scp with different ports

Matt Johnston matt at ucc.asn.au
Wed Apr 17 23:18:42 WST 2013


I've applied this with % as the delimiter instead, since #
breaks some shells (eg echo "echo thing#blah" | csh  )

Cheers,
Matt

On Wed, Apr 17, 2013 at 02:23:52PM +0200, Hans Harder wrote:
> I had some problems with the multihop for scp using different portnumbers.
> The original syntax uses / as separator, which conflicts with the
> current code in scp for detecting source and destination
> Ex.  scp file user at host1/2222,user at host2/22:.
> 
> Simplest way of solvng this was to allow also another char as
> separator for a port, like '#'
> So you can do: scp file user at host1#2222,user at host2#22:.
> 
> Just a one liner, which allows now to use both chars as a separator
> 
> 
> --- cli-runopts.c      2013-04-15 08:01:57.000000000 -0600
> +++ cli-runopts.c  2013-04-17 06:14:56.000000000 -0600
> @@ -611,6 +611,7 @@ static void parse_hostname(const char* o
>         }
> 
>         port = strchr(cli_opts.remotehost, '/');
> +        if (!port)  port = strchr(cli_opts.remotehost, '#');
>         if (port) {
>                 *port = '\0';
>                 cli_opts.remoteport = port+1;


More information about the Dropbear mailing list