core icon indicating copy to clipboard operation
core copied to clipboard

File is deleted when it shouldn't after trying to move a file (from a shared folder) with the same name as one that is already in root

Open purigarcia opened this issue 13 years ago • 33 comments

Expected behaviour

The file "photo.JPG" shouldn't be deleted from root and it is been deleted The file "photo.JPG" shouldn't be deleted from folder "A" inside "Shared" folder and it doesn't

Actual behaviour

The file "photo.JPG" is deleted from root when it shouldn't

Steps to reproduce

  1. There are two users in the server (user1 and user2)

  2. In the server, log in owncloud as user 1

  3. Share a folder called "A" with user2.

  4. Give him only update permission

  5. Log in own cloud as user2

  6. Upload in root a file, for instance photo.JPG

  7. Now using webdav protocol, try to move a file called "photo.JPG" from a shared folder "A" to root. Notice that you don't have the correct permission so in the end the file isn't going to be moved. We are going to see do it using poster (complement in firefox) (screenshot is attached)

     * URL:server/remote.php/webdav/Shared/A/photo.JPG
     * User: user2 
     * password:
     * Action:MOVE
     * Headers
              - Destination: server/remote.php/webdav/photo.JPG
              - Overwrite: T
    

    screen shot 2013-10-09 at 6 40 39 pm 2

  8. An error 403 is sent

  9. In the server, logged as user2 account, refresh the account and then photo.JPG is deleted from root when it shouldn't

Server configuration

Operating system: openSUSE

Database: SQLite 3

ownCloud version: {"installed":"true","version":"5.80.8.1","versionstring":"6.0 pre alpha","edition":""}

Client configuration

Browser: Chrome

Operating system: MaOs 10.7.5

purigarcia avatar Oct 10 '13 06:10 purigarcia

Can you please retest this with alpha 1? THX

DeepDiver1975 avatar Oct 10 '13 10:10 DeepDiver1975

Yes, it happens with this version {"installed":"true","version":"6.0.0.0","versionstring":"6.0 alpha 1","edition":""} also

purigarcia avatar Oct 10 '13 14:10 purigarcia

@purigarcia what exactly is the operation - the description is not that clear - is the file move from root to the shared folder or from the shared folder to root?

DeepDiver1975 avatar Oct 14 '13 17:10 DeepDiver1975

From Shared to root is failing because of this check as https://github.com/owncloud/core/blob/master/lib/private/connector/sabre/objecttree.php#L90. Behavior is as expected

DeepDiver1975 avatar Oct 14 '13 17:10 DeepDiver1975

a Move from root to Shared has issues ....

DeepDiver1975 avatar Oct 14 '13 17:10 DeepDiver1975

@purigarcia @rperezb please retest with current git master - THX

DeepDiver1975 avatar Oct 14 '13 21:10 DeepDiver1975

Hey @DeepDiver1975 ,

tested with master, stalled":"true","version":"5.0.0.1","versionstring":"6.0 alpha 2","edition":""}

and it´s not working

Steps to reproduce

  1. There are two users in the server (user1 and user2)
  2. log in owncloud as USER2, create:
    • On the root upload a file and call it: photo.JPG
  3. Log in as USER1
    • Create a folder called A and inside it a file: photo.JPG
  4. Share the folder called "A" with UPDATE permission with user2.
  5. Log in as user2
  6. Now using webdav protocol, move a file called "photo.JPG" from the shared folder "A" to root. Notice that you don't have the right permission so at the end the file isn't going to be moved.

KEY POINT: we select to overwrite the file

We are going to see do it using poster (complement in firefox) (screenshot is attached)

     * URL:server/remote.php/webdav/Shared/A/photo.JPG
     * User: user2 
     * password:
     * Action:MOVE
     * Headers
              - Destination: server/remote.php/webdav/photo.JPG
              - Overwrite: T

screen shot 2013-10-09 at 6 40 39 pm 2 5. An error 403 is sent, expected 6. In the server, logged as user2 account, refresh the account and then photo.JPG is deleted from root when it shouldn't

rperezb avatar Oct 16 '13 16:10 rperezb

Can you please test without the Overwrite header? No idea if we support that. THX

DeepDiver1975 avatar Oct 16 '13 17:10 DeepDiver1975

I try it, however, on the mobile app, we do support it.

rperezb avatar Oct 17 '13 06:10 rperezb

TESTED it: {"installed":"true","version":"5.0.0.1","versionstring":"6.0 alpha 2","edition":""}

OVERWRITE: F

Works fine, the file is not moved, neither deleted.

screen shot 2013-10-17 at 12 29 12

OVERWRITE: T

It does not work fine, the file on the root is deleted. This affects mobile apps

screen shot 2013-10-17 at 12 27 14

rperezb avatar Oct 17 '13 10:10 rperezb

should be fixed

karlitschek avatar Nov 29 '13 16:11 karlitschek

Tested again using OVERWRITE=T and it's not fixed

Using daily instance (http://daily.owncloud.com/master/owncloud) {"installed":"true","version":"6.90.0.1","versionstring":"7.0 pre alpha","edition":""}

purigarcia avatar Jan 21 '14 08:01 purigarcia

@karlitschek who can take care of this?

DeepDiver1975 avatar Jan 21 '14 08:01 DeepDiver1975

@purigarcia are you still seeing this in OC 7.0.3 ?

PVince81 avatar Dec 05 '14 17:12 PVince81

I check it with the latest version of daily/ stable7 and it's still happening {"installed":"true","version":"7.0.4.2","versionstring":"7.0.4","edition":""}

purigarcia avatar Dec 16 '14 12:12 purigarcia

we should reevaluate this now in master with the new sabredav implementation -> 8.2

DeepDiver1975 avatar Mar 20 '15 17:03 DeepDiver1975

Is this still happening with 7.0.7, 8.0.5 or 8.1 ? (8.1 has the new sabredav implementation)

PVince81 avatar Aug 03 '15 13:08 PVince81

@davitol could you check it? thank you

purigarcia avatar Aug 04 '15 12:08 purigarcia

:+1: Tested in 8.1.1 ("version":"8.1.1.3","versionstring":"8.1.1") and it works fine :white_check_mark: Tested in 8.0.5 ("version":"8.0.5.2","versionstring":"8.0.5") and it works fine :white_check_mark: Tested in 7.0.7 ("version":"7.0.7.2","versionstring":"7.0.7") and it works fine :white_check_mark:

davitol avatar Aug 13 '15 16:08 davitol

:-1: still happening on stable8.1. I used cadaver to move "/A/test.txt" to "/test.txt" as recipient. Even though I have no move permission for that file, the file "/test.txt" disappeared.

@davitol I guess you probably misread some of the steps.

PVince81 avatar Aug 17 '15 14:08 PVince81