curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: SCP to Cisco device

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 5 Jul 2018 08:23:27 +0200 (CEST)

On Wed, 4 Jul 2018, Martin Galvan wrote:

> Hi Daniel, thanks for the answer. Unfortunately I don't have time right now
> for re-building the SSH libs to debug them. I'm using the libssh/2 versions
> that I got from the Ubuntu 17.10 libssh-dev and libssh2-1-dev packages, so
> it's not some exotic case. I'm surprised this hasn't happened to someone
> else by now, especially the segfault case. This isn't happening just for the
> Cisco device; *any* attempt to SCP ends up segfaulting. Could you test it
> yourself?

I did a quick check and I found two things:

1. I can get a file fine over SCP with the libssh backend when I do:

   curl scp://localhost/tmp/moo -u user:pwd

2. I can however trigger an assert if I leave out the path part from the URL:

   curl scp://localhost/ -u user:pwd

The second issue made me file an issue on github:

   https://github.com/curl/curl/issues/2708

> Assuming it's the -p option that's breaking stuff as it was in Mike's case, how
> could we fix this? I really don't want to start hacking libcurl myself to reach
> a fragile workaround, as this needs to go into production.

If the "preserve properties" action is the problem then I think we should do
what I suggested already five years ago: have a fall-back mode that can retry
without asking for them. It seems nobody took up the task back then. Possibly
because not that many can reproduce this and it makes it pretty annoying to
work on. It should be worthwhile to do a first "hack" to verify if removing
those options from the SCP command line actually makes things work before
spending a lot of time on this...

But I don't know how libssh handles this situation. Maybe it already works
around it?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-07-05