Skip to content

Part file error handling with s2s might cause original file deletion #17284

Closed

Description

@PVince81

Steps

  1. Setup two servers A and B
  2. Create a folder "local" on A
  3. Create a file "local/test.txt" on A
  4. Share "local" with a user on server B
  5. On server B, modify https://github.com/owncloud/core/blob/master/lib/private/connector/sabre/file.php#L143 and add +1 to the condition to simulate a size mismatch / upload issue
  6. On server B, use WebDAV and PUT a file in "local/test.txt" to overwrite it

Expected result

Upload fails, original file still exists on A.

Actual result

Upload fails with "Internal server error", original file disappears from A.

Versions

ownCloud 8.1 RC2

This problem is introduced by #17189.
When using federation, part files are disabled so $partPath contains the real path.
Whenever an error appears, the exception handling will try and delete the $partPath believing that it's the part file when in fact it's the real file.

Fix is here #17268 (comment)

Activity

  1. added this to the milestone on Jul 1, 2015
  2. PVince81 commented on Jul 1, 2015

    @PVince81
    ContributorAuthor

    @cmonteroluque @karlitschek @DeepDiver1975 please evaluate severity/priority.

  3. self-assigned this
    on Jul 1, 2015
  4. MorrisJobke commented on Jul 1, 2015

    @MorrisJobke
    Contributor

    Fixed with #17268

  5. MorrisJobke commented on Jul 1, 2015

    @MorrisJobke
    Contributor

    Backport for 8.1.1 is ready: #17289

  6. locked as resolved and limited conversation to collaborators on Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions