mike.mackintosh at angrystatic.com
2011-Nov-11 16:57 UTC
SCP fails to locate remote file: '-- <filename>'
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. -------------- next part -------------- A non-text attachment was scrubbed... Name: scp.patch Type: text/x-diff Size: 1272 bytes Desc: not available URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20111111/c19a2dc8/attachment.bin>
Dag-Erling Smørgrav
2011-Nov-13 12:49 UTC
SCP fails to locate remote file: '-- <filename>'
mike.mackintosh at 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 - des at des.no