Unable to "ls" within a directory with special characters "[" or "]" Issue appears as follows once connected to remote SFTP server: sftp> pwd Remote working directory: /foo sftp> ls directory [one] sftp> cd directory\ [one] sftp> pwd Remote working directory: /foo/directory [one] sftp> ls Can't ls: "/foo/directory [one]" not found However, the client is freely able to list the directory contents when outside the directory that contains the special characters: "[" and/or "]" sftp> ls "/foo/directory [one]" Successful.
What platform is this? I can't reproduce the problem on either OpenBSD or Fedora. $ cd /tmp $ mkdir directory\ [one] $ cd directory\ \[one\]/ $ touch bar $ sftp localhost Connected to localhost. sftp> cd /tmp/directory\ [one]/ sftp> pwd Remote working directory: /tmp/directory [one] sftp> ls bar sftp> A couple of things you can try: ./configure --with-cflags=-DBROKEN_REALPATH ./configure --with-cflags=-DBROKEN_GLOB and see if either of these makes the problem go away.
OS-X Snow Leopard 10.6.4 SSH Version Info: OpenSSH_5.5p1, OpenSSL 0.9.8l 5 Nov 2009 Issue persists with re-compiling using ./configure flags. (In reply to comment #1) > What platform is this? I can't reproduce the problem on either OpenBSD > or Fedora. > > $ cd /tmp > $ mkdir directory\ [one] > $ cd directory\ \[one\]/ > $ touch bar > $ sftp localhost > Connected to localhost. > sftp> cd /tmp/directory\ [one]/ > sftp> pwd > Remote working directory: /tmp/directory [one] > sftp> ls > bar > sftp> > > A couple of things you can try: > > ./configure --with-cflags=-DBROKEN_REALPATH > > ./configure --with-cflags=-DBROKEN_GLOB > > and see if either of these makes the problem go away.
(In reply to comment #2) > OS-X Snow Leopard 10.6.4 OK, I can reproduce it with 5.5p1, but I think it's since been fixed (bug #1655). Please try a snapshot http://www.mindrot.org/openssh_snap/
I can't elicit this in -current.
Move resolved bugs to CLOSED after 5.7 release