Skip to content

externally renaming a file/folder in a files_external storage breaks the contained shares  #11533

Closed

Description

@butonic

Steps to reproduce

  1. mount a webdav endpoint with files external to wd.
  2. in oc create three folders f1, f2, f3
  3. note down the file ids of these folders
  4. outside of oc delete f2 and rename f3 -> f2
  5. refresh the wd folder in oc
  6. compare the fileids of f2

Expected behaviour

f2 should have the file id of f3 in step 3

Actual behavior

f2 still has the same fileid as f2 in step 3. The whole directory tree of f3 (now f2) is rescanned and will receive new file ids. That in itself is not yet a problem, but the root cause for any shares that have been created between step 3 & 4 inside f3 to break, because they now point to a no longer existing fileid.

The issue is a result of the rescan process which currently does not have any means to detect a rename. @icewind1991 The only hack I see for default WebDAV endpoints is to use a heuristic that compares the folder contents in the cache with those in the remote location and tries to guess the right rename ... no Idea how csync detects renames. @danimo my guess is it takes into account file ids and maybe inodes?

The problem of course applies to all external storages that are not used exclusively. The question is how do we solve it. For ownCloud DAV mounts we cold expose the file id in the webdav result ... however that is probably a bad idea security wise: http://stackoverflow.com/questions/12378220/api-design-and-security-why-hide-internal-ids cc @LukasReschke

But I don't see any other way to make renames in inter cloud shares more robust.

Thougts?

Activity

  1. vasyugan commented on Oct 14, 2014

    @vasyugan

    Are there any known workarounds for the time being? Is there any way to force a full rescan of the external storage? I have mounted a Dropbox folder, which is frequently modified externally. It seems they are increasingly getting out of sync.

  2. butonic commented on Oct 20, 2014

    @butonic
    ContributorAuthor

    Remember, this issue is about loosing shares when a rescan occurs. That being said you can rescan the files on the command line with occ:

    > php occ files:scan <username>
    

    or in the browser console with

    scanFiles(true,'/')
    
  3. added this to the milestone on Oct 27, 2014
  4. schiessle commented on Nov 10, 2014

    @schiessle
    Contributor

    Remember, this issue is about loosing shares when a rescan occurs.

    Didn't test it. But if I understand your description correct it is not only about losing shares but also about accidentally sharing stuff which shouldn't be shared. If f2 was shared to someone before you delete it and rename f3 to f2, f3 will be shared because it will have the file id from the old f2.

    This could be a huge privacy risk because it can expose internal data to user you don't want to or even to the public in case of link shares.

    Not sure how we can solve this problem reliable. False-positives can be even more dangerous than losing a share, because this would mean that you share something which shouldn't be shared.

    Btw, as far as I know the sync client detects renames based on the file-id which will not change in this case.

  5. modified the milestones: , 2014-sprint-07 on Nov 10, 2014
  6. modified the milestones: , on Jan 7, 2015
  7. 29 remaining items

  8. ownclouders commented on Jan 13, 2018

    @ownclouders
    Contributor

    Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

    (This is an automated comment from GitMate.io.)

  9. ownclouders commented on Feb 23, 2018

    @ownclouders
    Contributor

    Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

    (This is an automated comment from GitMate.io.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions