[Bug 2966] scp rev 1.202 fix doesn't quite hit the mark

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Fri Apr 5 09:37:25 AEDT 2019


https://bugzilla.mindrot.org/show_bug.cgi?id=2966

Jordan <jborean93 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jborean93 at gmail.com

--- Comment #2 from Jordan <jborean93 at gmail.com> ---
Just to add a bit more to this problem, I've found that using single
quotes for the path component also causes it to fail with 'filename
does not match request'. For example If I was to do;

    scp -o User=username "[host]:'/tmp/file.txt'"

or even

    scp -o User=username '[host]:'"'"'/tmp/file.txt'"'"''

It will fail with

    protocol error: filename does not match request

This worked perfectly fine before this patch and I don't see a reason
why it shouldn't continue to work going forward. Quotes aren't used all
the time but if the path we are trying to fetch has a space it is
needed. We also use single quotes so we don't have to escape any
metachars, e.g.

    scp -o User=username '[host]:'"'"'/tmp/file $TERM.txt'"'"''

Would fetch the literal path '/tmp/file $TERM.txt' and not expand
$TERM. An alternate way would be to escape paths and meta chars with
'\' but that seems to be dependent on the shell used on the remote and
potentially fraught with danger. Being able to just enclose the path
with a single quote is a lot simpler.

https://github.com/ansible/ansible/issues/52640 has some more issues
and how we came across this problem.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.


More information about the openssh-bugs mailing list