Bug 1263237 - sftp doesn't handle '#' within filenames for transfer
sftp doesn't handle '#' within filenames for transfer
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openssh (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Jakub Jelen
BaseOS QE Security Team
Depends On:
  Show dependency treegraph
Reported: 2015-09-15 08:06 EDT by Sameer Jadhav
Modified: 2016-02-21 19:58 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-11 04:23:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 2 Jakub Jelen 2015-09-15 09:16:55 EDT
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

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.

Note You need to log in before you can comment on or make changes to this bug.