Skip to content

Use fileid for files_target for shares, have a real existing mount point folder #14396

Closed

Description

@PVince81

Given the following situation:

  1. Create two users "user1" and "user2"
  2. "user1" shares a folder "test" with "user2"
  3. "user2" renamed "test" to "my test"

The current data structure works as follows:

  • The share is added into "oc_share" and "files_target" is set to "test".
  • The folder "test" is mounted in "user2"'s filesystem based on the name in "files_target"
  • When "user2" renames "test" (the mount point), we need special logic because the name is actually in the "oc_share" table

The problem with this is that the virtual shared folder's name is in the "oc_share" table which requires a lot of specialized logic to handle such cases.

I suggest to change the mount logic to work like Linux filesystems, which means that the target mount point must be an existing empty folder (or empty file):

  • auto-create a folder "test" in "user2"'s filesystem. This gives it a real entry in "oc_filecache"
  • create an entry in "oc_share" but have "files_target" point to the fileid of that empty folder
  • whenever "user2" renames or moves "test", there is no need for special logic any more, no need to touch "oc_share".

To be discussed/researched.

Activity

  1. PVince81 commented on Feb 20, 2015

    @PVince81
    ContributorAuthor
  2. PVince81 commented on Jul 14, 2015

    @PVince81
    ContributorAuthor

    Another problem that was discovered recently is that we store the full path to the target in "files_target" which can bump against max length limits, and also max index length limits (#17639).

  3. rullzer commented on Jul 15, 2015

    @rullzer
    Contributor

    Yep I agree that the current setup of the oc_share table is far from optimal. Changes like this should really go into sharing 2.0

  4. added this to the backlog milestone on Mar 1, 2016
  5. PVince81 commented on Feb 28, 2017

    @PVince81
    ContributorAuthor

    An alternative to this is simply using the oc_mounts table, which didn't exist at the time of this writing.
    See #26190

  6. 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.)

  7. 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