Bug 1263237

Summary: sftp doesn't handle '#' within filenames for transfer
Product: Red Hat Enterprise Linux 6 Reporter: Sameer Jadhav <sajadhav>
Component: opensshAssignee: Jakub Jelen <jjelen>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.8CC: akarande, plautrba
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-11 09:23:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 2 Jakub Jelen 2015-09-15 13:16:55 UTC
Hi Sameer,
the upstream bug was closed with resolution "WORKSFORME", which means that there was nothing fixed in openssh-7.1 related to this bug. The official proposed solution is to use quotes around the strings with # characters.

The behavior looks a bit different from default bash behavior and from the last comment and my testing emerges that the proposed solution doesn't work much on command-line with scp syntax, regardless the quotes:

$ sftp localhost:"/tmp/a#a"
File "/tmp/a" not found.

The only workaround I found was to use batch file (and public key authentication):

$ sftp -b <(echo 'get "/tmp/c#c"') localhost
sftp> get "/tmp/c#c"
$ ls c#c
c#c

Changing this behavior in this late release would be problematic and could result in regression. If customer is not satisfied with batch-mode-solution, I will try to reopen upstream bug and discuss our use case.