[Bug 2528] New: sftp "put -r ." broken starting with 6.8

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Wed Jan 20 05:25:59 AEDT 2016


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

            Bug ID: 2528
           Summary: sftp "put -r ." broken starting with 6.8
           Product: Portable OpenSSH
           Version: 6.8p1
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: sftp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: vapier at gentoo.org

here's the testcase:
  cd ~/
  rm -rf test x
  mkdir -p x/test
  touch x/test/{1,2,3}
  cd x
  sftp localhost <<<'put -r .'

with openssh-6.7 and older, you'd get:
Connected to localhost.
sftp> put -r .
Uploading ./ to /home/vapier/.
Entering ./
Entering ./test
./test/3   100%    0     0.0KB/s   00:00
./test/2   100%    0     0.0KB/s   00:00
./test/1   100%    0     0.0KB/s   00:00

starting with openssh-6.8, you get:
Connected to localhost.
sftp> put -r .
Uploading ./ to /home/vapier/.
Entering ./

and nothing is actually uploaded.  the failure is due to the remote
doing mkdir(/home/vapier/.), getting EEXIST, and then returning an
error to the client which makes it stop.

bisecting the public github repo shows the first bad commit is this
one:
https://github.com/openssh/openssh-portable/commit/7d845f4a0b7ec97887be204c3760e44de8bf1f32
(i had to cherry pick 0cdc5a3eb6fb383569a4da2a30705d9b90428d6b and
83b9678a62cbdc74eb2031cf1e1e4ffd58e233ae to get it to build)

its parent obviously works fine too:
https://github.com/openssh/openssh-portable/commit/139ca81866ec1b219c717d17061e5e7ad1059e2a

it might be that the new one is doing more error checking, but it seems
like the server or client should handle EEXIST correctly.

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


More information about the openssh-bugs mailing list