diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-06-29 16:45:08 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-06-29 17:31:14 +0200 |
commit | 167f57c15e8d073506810a6c3b3cbc18f0b84c0c (patch) | |
tree | a6db0db4fb361c0e2c2e3352523f27b56baacdc7 /lib | |
parent | 3217d4dad156a056ea2aff3542cd24bce39c7658 (diff) | |
download | nextcloud-server-167f57c15e8d073506810a6c3b3cbc18f0b84c0c.tar.gz nextcloud-server-167f57c15e8d073506810a6c3b3cbc18f0b84c0c.zip |
Unlock first path on rename if second path is locked
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/view.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 0c3bc54a41d..f2df2eb0f69 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -631,7 +631,12 @@ class View { } $this->lockFile($path1, ILockingProvider::LOCK_SHARED, true); - $this->lockFile($path2, ILockingProvider::LOCK_SHARED, true); + try { + $this->lockFile($path2, ILockingProvider::LOCK_SHARED, true); + } catch (LockedException $e) { + $this->unlockFile($path1, ILockingProvider::LOCK_SHARED); + throw $e; + } $run = true; if ($this->shouldEmitHooks() && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2))) { |