[Bug 3488] New: scp fails to locate remote paths containing a non-empty square bracket pair

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sun Oct 23 16:10:16 AEDT 2022


https://bugzilla.mindrot.org/show_bug.cgi?id=3488

            Bug ID: 3488
           Summary: scp fails to locate remote paths containing a
                    non-empty square bracket pair
           Product: Portable OpenSSH
           Version: 9.1p1
          Hardware: amd64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: scp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: burnsmellfactory at gmail.com

I'm noticing this issue in OpenSSH 9.0p1 and 9.1p1.

If the remote path contains a matched square bracket pair (i.e. '['
followed sometime later by ']'), and there is any text between the
opening and closing square brackets, scp fails to locate that path.

If I have the following files on a remote server:
A) foo[]
B) foo]0[
C) foo[0
D) foo0]
E) foo[0]
F) foo[x]
G) bar[/foo]
H) bar[/]foo

And on a client I try to scp them like so:
A) scp -pr "user at host:/path/foo[]" .
B) scp -pr "user at host:/path/foo]0[" .
C) scp -pr "user at host:/path/foo[0" .
D) scp -pr "user at host:/path/foo0]" .
E) scp -pr "user at host:/path/foo[0]" .
F) scp -pr "user at host:/path/foo[x]" .
G) scp -pr "user at host:/path/bar[/foo]" .
H) scp -pr "user at host:/path/bar[/]foo" .

A, B, C, and D will succeed.  E, F, G, and H will all fail with the
error:
scp: /path/...: No such file or directory
And the path in the error message will match exactly the path that does
in fact exist.

As you can see with case H, the pair doesn't have to occur within a
single path component, it can occur anywhere across the entire path.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list