sftp rename dir1 dir2 will rename dir1 => dir2/dir1
Bug #87934 reported by
John A Meinel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Jonathan Lange | ||
Twisted |
Fix Released
|
Unknown
|
Bug Description
sftp://
Steps to reproduce:
sftp> mkdir ~user/+junk/junk
sftp> cd ~user/+junk/junk
sftp> mkdir directory1
sftp> mkdir directory2
sftp> rename directory1 directory2
sftp> ls
directory2
sftp> ls directory2
directory2/
sftp>
It should have failed the rename rather than putting it as a subdirectory.
Some filesystems will allow directory1 to overwrite directory2, so a better test would include adding at least one file into both directories first.
Changed in launchpad-bazaar: | |
assignee: | nobody → spiv |
status: | Unconfirmed → Confirmed |
Changed in launchpad-bazaar: | |
importance: | Undecided → High |
Changed in twisted: | |
importance: | Undecided → Unknown |
status: | Unconfirmed → Unknown |
Changed in launchpad-bazaar: | |
status: | Fix Committed → Fix Released |
Changed in twisted: | |
status: | Unknown → Fix Released |
To post a comment you must log in.
For comparison, here's the behaviour of an OpenSSH SFTP server (serving an ext3 filesystem on linux):
$ sftp localhost localhost' s password:
Connecting to localhost...
andrew@
sftp> cd /tmp
sftp> mkdir directory1
sftp> mkdir directory2
sftp> rename directory1 directory2
Couldn't rename file "/tmp/directory1" to "/tmp/directory2": Failure
So it's not just a peculiarity of the OpenSSH's sftp client.