Bug 2919 - Quoting of filenames with spaces is inconsistent when downloading/uploading
Summary: Quoting of filenames with spaces is inconsistent when downloading/uploading
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 7.5p1
Hardware: amd64 Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-17 20:26 AEDT by Jari
Modified: 2020-02-14 15:59 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jari 2018-10-17 20:26:36 AEDT
This is something that has been bugging me for a while and I always stumble on it trying to remember which form to use
I can't find anything in the changelog that looks similar to this having been fixed 

Downloading:
vague@IS-C0HVFBY:~$ /usr/bin/scp root@amodev:"/root/projects/management-packs/XI\ Gridhost.json" .
root@amodev's password:
XI Gridhost.json
vague@IS-C0HVFBY:~$ /usr/bin/scp root@amodev:"/root/projects/management-packs/XI Gridhost.json" .                                                                                                                                                                                                                             
root@amodev's password:                                                                                                                                                                                                                                                                                                       
scp: /root/projects/management-packs/XI: No such file or directory                                                                                                                                                                                                                                                            
scp: Gridhost.json: No such file or directory  
vague@IS-C0HVFBY:~$ /usr/bin/scp "root@amodev:/root/projects/management-packs/XI\ Gridhost.json" .                                                                                                                                                                                                                            
root@amodev's password:                                                                                                                                                                                                                                                                                                       
XI Gridhost.json
vague@IS-C0HVFBY:~$ /usr/bin/scp root@amodev:/root/projects/management-packs/XI\ Gridhost.json .                                                                                                                                                                                                                              
root@amodev's password:                                                                                                                                                                                                                                                                                                       
scp: /root/projects/management-packs/XI: No such file or directory                                                                                                                                                                                                                                                            
scp: Gridhost.json: No such file or directory

Uploading:
vague@IS-C0HVFBY:~$ /usr/bin/scp "XI\ Gridhost.json" admin@remote:                                                                                                                                                                                                                                                           
admin@remote's password:                                                                                                                                                                                                                                                                                                    
XI\ Gridhost.json: No such file or directory     
vague@IS-C0HVFBY:~$ /usr/bin/scp "XI Gridhost.json" admin@remote:                                                                                                                                                                                                                                                            
admin@remote's password:                                                                                                                                                                                                                                                                                                    
XI Gridhost.json                                                                                                                                                                                                                                                                             
vague@IS-C0HVFBY:~$ /usr/bin/scp XI\ Gridhost.json admin@remote:                                                                                                                                                                                                                                                            
admin@remote's password:                                                                                                                                                                                                                                                                                                    
XI Gridhost.json
Comment 1 Damien Miller 2020-01-26 00:31:53 AEDT
Unfortunately this is inherent to the way that scp works: one set of quote expansion is performed by your local shell and another by the remote shell that executes scp. This behaviour is inherited from BSD rcp from ~29 years ago :(
Comment 2 Damien Miller 2020-02-14 15:59:23 AEDT
Closing all resolved bug with release of openssh-8.2