[rest] Renaming a file into a folder overwrites the folder

Bug #987767 reported by Roman Yepishev
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Servers
Triaged
Undecided
Ubuntu One Foundations+ team

Bug Description

STR:

1. Create a directory with rest api - "/dirname"
2. Create upload a file with rest api - "/filename.bin"
3. Perform a rename with rest api with data = '{"path": "/dirname"} on "/filename.bin"

Expected results:
The file will be moved into the directory or the operation fails

Actual results:
The file overwrites the directory

Tags: foundations+
Roman Yepishev (rye)
visibility: private → public
Leo Arias (elopio)
Changed in ubuntuone-servers:
status: New → Triaged
assignee: nobody → Ubuntu One Foundations+ team (ubuntuone-foundations+)
tags: added: foundations+
Revision history for this message
James Henstridge (jamesh) wrote :

While it doesn't necessarily address the directory overwrite case, perhaps it would be useful to provide a way to tell the API that a particular invocation of this API is not intended to overwrite anything at the destination. If the call would cause an overwrite in this case, then it returns an error. The client can then decide what to do in that case (e.g. prompt the user for confirmation and repeat the call without disallowing overwrite).

This is the approach WebDAV took, for instance, where setting the "Overwrite" header to "F" will cause a COPY or MOVE request to return a "409 Conflict" response.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.