groupfolders icon indicating copy to clipboard operation
groupfolders copied to clipboard

Prevent received shares to stay on top of group folders

Open PVince81 opened this issue 3 years ago โ€ข 2 comments

This was with NC 24.0.5

Steps

  1. Create two users "alice" and "bob" into a group "group1"
  2. Login as "alice"
  3. Create a folder "share"
  4. Create a subfolder "share/in_share"
  5. Share "share" with "bob"
  6. Login as "bob"
  7. Create a folder "futuregroupfolder"
  8. Move "share" to "/futuregroupfolder/share". This puts the mount point on the legit folder "exists"
  9. Now we override the subdir with a group folder: as admin, create a group folder called "futuregroupfolder" and apply for the group "group1" and "admin"
  10. Put a folder as admin in "futuregroupfolder/in_groupfolder"
  11. Login as "bob"
  12. Enter "futuregroupfolder" and observe
  13. Check the oc_shar etable

=> The group folder contains both the contents "in_groupfolder" and also the received share "share" with its contents "in_share". => the oc_share table has a file_target pointing at "/futuregroupfolder/share"

I've seen a case where this situation was the best for an infinite loop of sorts which I couldn't reproduce yet.

In any case we should prevent such scenarios, not sure how.

When creating or renaming a group folder, detecting collisions for each users would be too expensive. Maybe something needs to be done in the mount manager initially to detect mount point overlaps and resolve them. Or in the sharing code verifyMountPoints where duplicate detection is happening, and check also every parent to make sure they are not point points ?

Thoughts ? @icewind1991 @CarlSchwan

PVince81 avatar Nov 08 '22 15:11 PVince81

or as a last resort: a background job ?

PVince81 avatar Nov 08 '22 15:11 PVince81

it seems we do have logic that automatically renames existing user folders whenever a sudden group folder with the same name appears, in the test case above you can also see a "futuregroupfolder (1)" folder existing.

so perhaps the latter logic needs to be extended to also process mount points while renaming, in oc_mounts and also oc_share

PVince81 avatar Nov 08 '22 15:11 PVince81