Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SCP fails to locate remote file: '-- <filename>'

3 views
Skip to first unread message

mike.ma...@angrystatic.com

unread,
Nov 11, 2011, 11:57:55 AM11/11/11
to
I am not sure if many people have run into this, but recently working
with some non-standard SSH capable devices, Routers, Firewalls and
Switches, I noticed SCP failed on many of them. Looking through logs I
saw:

SCP unable to find file: '-- config'

When looking through the verbose output from the issued command, it
was passing:

scp -v -f -- config

I am not sure why the -- is needed in this command. I have attached a
patch for scp.c to fix this functionality in the event anyone else
runs into this.
scp.patch

Dag-Erling Smørgrav

unread,
Nov 13, 2011, 7:49:20 AM11/13/11
to
mike.ma...@angrystatic.com writes:
> I am not sure if many people have run into this, but recently working
> with some non-standard SSH capable devices, Routers, Firewalls and
> Switches, I noticed SCP failed on many of them. Looking through logs I
> saw:
>
> SCP unable to find file: '-- config'
>
> When looking through the verbose output from the issued command, it
> was passing:
>
> scp -v -f -- config
>
> I am not sure why the -- is needed in this command.

Because the filename might begin with a dash, and -- tells getopt to
stop parsing options.

This is a bug in the router / firewall / switch, not in OpenSSH.

DES
--
Dag-Erling Smørgrav - d...@des.no
_______________________________________________
openssh-unix-dev mailing list
openssh-...@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

0 new messages