Incorrect shell quotation in scp

Christian Kurz shorty at getuid.de
Thu Dec 28 06:16:45 EST 2000


Hi,

as the current debian maintainer of the openssh package is a bit busy,
I'm helping him with fixing a part of the bugs in openssh that debian
users found will forward some of the reports to you. This is the first
one and a fix or a comment why this should not be fixed would be
appropriated. Thanks

Space in filename is not correctly passed by scp to other invoked
programs:

|host:/usr/src/xx# scp vana:/mnt2/mp3/Celine\ Dion/ .
|root at host.do.main's password:
|scp: /mnt2/mp3/Celine: No such file or directory
|scp: Dion/: No such file or directory
|host:/usr/src/xx# scp "vana:/mnt2/mp3/Celine Dion" .
|root at host.do.main's password:
|scp: /mnt2/mp3/Celine: No such file or directory
|scp: Dion: No such file or directory
|host:/usr/src/xx# scp vana:\"/mnt2/mp3/Celine Dion\" .
|root at host.do.main's password:
|bash: -c: line 1: unexpected EOF while looking for matching `"'
|bash: -c: line 2: syntax error: unexpected end of file
|sh: -c: line 1: unexpected EOF while looking for matching `"'
|sh: -c: line 2: syntax error: unexpected end of file
|host:/usr/src/xx# scp "vana:\"/mnt2/mp3/Celine Dion\"" .
|root at host.do.main's password:
|scp: /mnt2/mp3/Celine Dion: not a regular file
|host:/usr/src/xx#

|So only correct syntax is last one - "host:\"path\""... Everything
|else gives some unexpected results:

|host:/usr/src/xx# scp "vana:/; echo rwx666" .
|root at host.do.main's password:
|scp: /: not a regular file
|protocol error: expected control record
|host:/usr/src/xx#

|As command after ';' is not executed with uid of sshd (I believe), I'm 
|marking it as wishlist only...

-- 
While the year 2000 (y2k) problem is not an issue for us, all Linux
implementations will impacted by the year 2038 (y2.038k) issue. The Debian
Project is committed to working with the industry on this issue and we will
have our full plans and strategy posted by the first quarter of 2020.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 242 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20001227/6cf0ec90/attachment.bin 


More information about the openssh-unix-dev mailing list