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
Prevent version app operations when file is locked #17245
I think it is probably OK that the download of a version works. The version is a different file then the original one. So why should we block the version if the original file gets manipulated.
I agree that restore shouldn't work. But what is the problem here? File versions always uses a view, so the same locking logic should be applied as for every other file? If you try to move a version to the original file and the original file is already locked the restore operation should be blocked.
Downloading a version might work yes, thanks to the background job expiration the old "to be expired" version might still exist at the time of the download, even though the pending upload would expire it.
Even if the versions app uses the view, the restore operations aren't done within a view operation. Also if the view is working on the version file instead of the original one, it will lock the version file instead of the original file.
I think like for encryption and others we need to explicitly set a lock on the original file before we start the sub-operations for a file restore, and unlock at the end of it. (to make it a real transaction)
If someone is currently moving the file, there is another process that will move the versions in process B while process A is trying to retrieve its list. We should at least set a shared lock on the original file here. The move operation would then set an exclusive lock on the file.
Activity
PVince81 commentedon Jun 29, 2015
Tentatively setting to 8.1, but not sure if enough time to fix it.
PVince81 commentedon Jul 1, 2015
@cmonteroluque @karlitschek @DeepDiver1975 moving to 8.1.1.
Needed to make locking more watertight.
schiessle commentedon Jul 1, 2015
I think it is probably OK that the download of a version works. The version is a different file then the original one. So why should we block the version if the original file gets manipulated.
I agree that restore shouldn't work. But what is the problem here? File versions always uses a view, so the same locking logic should be applied as for every other file? If you try to move a version to the original file and the original file is already locked the restore operation should be blocked.
PVince81 commentedon Jul 1, 2015
Downloading a version might work yes, thanks to the background job expiration the old "to be expired" version might still exist at the time of the download, even though the pending upload would expire it.
Even if the versions app uses the view, the restore operations aren't done within a view operation. Also if the view is working on the version file instead of the original one, it will lock the version file instead of the original file.
I think like for encryption and others we need to explicitly set a lock on the original file before we start the sub-operations for a file restore, and unlock at the end of it. (to make it a real transaction)
PVince81 commentedon Jul 1, 2015
Without transaction, have a look at https://github.com/owncloud/core/blob/master/apps/files_versions/lib/storage.php#L294 and for every file operation, ask yourself what could go wrong if someone else moved/deleted/overwrote the original file in-between.
PVince81 commentedon Jul 1, 2015
Same question actually for
getVersions(): https://github.com/owncloud/core/blob/master/apps/files_versions/lib/storage.php#L349If someone is currently moving the file, there is another process that will move the versions in process B while process A is trying to retrieve its list. We should at least set a shared lock on the original file here. The move operation would then set an exclusive lock on the file.