You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lock sharing operations when file is locked #17243
(this will delay the delete operation)
4. Create a file "bacon.txt"
5. Start cadaver and delete the file "bacon.txt"
6. During the deletion, in the web UI, share "bacon.txt" with "user2"
Expected result
File cannot be shared because it is locked by the deletion.
Actual result
File can still be shared.
If the file disappears during the sharing logic, there might be unpredictable results as the sharing code assumes the file is still there.
Yes, as the action of sharing it doesn't affect it.
However the question is what happens if the recipient's parent folder (the folder that will receive the share) currently has an exclusive lock 😦
Maybe that last part should be handled at the time the mount point is created (the one that also resolves naming conflicts), not when the share is created.
Should we lock if we create/modify a share? (lock exclusive?)
Not sure. The question is also what to lock, the parent folder ? If creating/modifying a share, it might be enough to set a "shared lock" on the file to prevent people deleting/moving the file while the share is in the process of being created.
Should we read lock if we fetch a share?
If with fetching a share you mean getting the contents of the file/folder, we already do that. The shared lock is set on the owner's file/folder.
So with the share manager this is getting easier. Since we can do proper locking and unlocking in one place now. However I would like to have locking operations on the node level then. Can that be arranged @icewind1991 ?
Ok so after looking into this. I don't think we can do the locking in the manager. We also require the manager for ownership transfers (where we require lazy shares). And locking the node makes it so the node has to resolve to something.
However, I think we can get away here with locking in the OCS Share API. Which is the most logic place anyway. Other parts that want to use the Share Manager have to do their own locking.
Activity
PVince81 commentedon Jun 29, 2015
@DeepDiver1975 @cmonteroluque I scheduled to 8.2, I don't think there is time left for this
PVince81 commentedon Jun 29, 2015
In general we should look into locking paths when calling Share APIs (whether share, unshare, unshare from self, etc).
rullzer commentedon Nov 15, 2015
So what is the behaviour we want here?
PVince81 commentedon Nov 16, 2015
Yes, as the action of sharing it doesn't affect it.
However the question is what happens if the recipient's parent folder (the folder that will receive the share) currently has an exclusive lock 😦
Maybe that last part should be handled at the time the mount point is created (the one that also resolves naming conflicts), not when the share is created.
Not sure. The question is also what to lock, the parent folder ? If creating/modifying a share, it might be enough to set a "shared lock" on the file to prevent people deleting/moving the file while the share is in the process of being created.
If with fetching a share you mean getting the contents of the file/folder, we already do that. The shared lock is set on the owner's file/folder.
icewind1991 commentedon Nov 16, 2015
I think we only need a read lock when creating a share
rullzer commentedon Feb 10, 2016
So with the share manager this is getting easier. Since we can do proper locking and unlocking in one place now. However I would like to have locking operations on the node level then. Can that be arranged @icewind1991 ?
Anyway not 9.0 I think @PVince81 @cmonteroluque
PVince81 commentedon Feb 10, 2016
Problem is: the Webdav code doesn't use the Node API... so locking will not happen if we do it on the Node API level.
However locking is usually done on View level, and the Node API is using the view. Any trouble with this ?
8 remaining items
icewind1991 commentedon Mar 3, 2016
Where you go #22812
rullzer commentedon Mar 7, 2016
Ok so after looking into this. I don't think we can do the locking in the manager. We also require the manager for ownership transfers (where we require lazy shares). And locking the node makes it so the node has to resolve to something.
However, I think we can get away here with locking in the OCS Share API. Which is the most logic place anyway. Other parts that want to use the Share Manager have to do their own locking.
Add locking to modifying operation of the OCS Share API
Add locking to modifying operation of the OCS Share API
Add locking to modifying operation of the OCS Share API
Add locking to modifying operation of the OCS Share API
Add locking to modifying operation of the OCS Share API
Add locking to modifying operation of the OCS Share API
lock commentedon Aug 4, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.