| Summary: | sftp issues with [ or ] in path name | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Andreas Hasenack <andreas> | ||||
| Component: | sftp | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | NEW --- | ||||||
| Severity: | normal | CC: | cjwatson, djm, dtucker | ||||
| Priority: | P5 | ||||||
| Version: | 8.0p1 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 3549, 3270 | ||||||
| Attachments: |
|
||||||
|
Description
Andreas Hasenack
2019-09-10 23:31:19 AEST
Created attachment 3440 [details]
Retry unglobbed filename on get remote_glob failure
I think this should fix it.
Filenames for sftp get commands are processed using remote_glob() to wildcard-expand them. In this case it was interpreting and eating the special characters.
This patch makes the remote_glob() call return the original, unmodified filename when expansion fails. Pretty much every other remote_glob() call in the sftp client already does this for precisely this reason.
retarget to 8.6 retarget after 8.6p1 release I wondered whether this change from the OpenSSH 9.1/9.1p1 release notes might relate to this bug: * sftp(1), scp(1): when performing operations that glob(3) a remote path, ensure that the implicit working directory used to construct that path escapes glob(3) characters. This prevents glob characters from being processed in places they shouldn't, e.g. "cd /tmp/a*/", "get *.txt" should have the get operation treat the path "/tmp/a*" literally and not attempt to expand it. It doesn't seem to have used the same patch as Damien posted here in 2020, but nevertheless the bug seems to be fixed: I can no longer reproduce it using Andreas's procedure. Should this be closed? |