summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-05-13 11:36:40 +0200
committerRobin Appelman <icewind@owncloud.com>2015-06-01 13:22:56 +0200
commit0775e9c1ca95a3f93b1069610fd89a0801f9f897 (patch)
tree0cf2bac5bb57bd2d65ba57242eb44b5efe3577e8
parent5edf294ce597c59c204c37e9fb753807ab40082f (diff)
downloadnextcloud-server-0775e9c1ca95a3f93b1069610fd89a0801f9f897.tar.gz
nextcloud-server-0775e9c1ca95a3f93b1069610fd89a0801f9f897.zip
Use md5 for lock key
-rw-r--r--lib/private/files/storage/common.php4
-rw-r--r--lib/private/files/view.php16
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 045011725ed..1c54f7cbc14 100644
--- a/lib/private/files/storage/common.php
+++ b/lib/private/files/storage/common.php
@@ -630,7 +630,7 @@ abstract class Common implements Storage {
* @throws \OCP\Lock\LockedException
*/
public function acquireLock($path, $type, ILockingProvider $provider) {
- $provider->acquireLock($this->getId() . '::' . $path, $type);
+ $provider->acquireLock(md5($this->getId() . '::' . $path), $type);
}
/**
@@ -639,6 +639,6 @@ abstract class Common implements Storage {
* @param \OCP\Lock\ILockingProvider $provider
*/
public function releaseLock($path, $type, ILockingProvider $provider) {
- $provider->releaseLock($this->getId() . '::' . $path, $type);
+ $provider->releaseLock(md5($this->getId() . '::' . $path), $type);
}
}
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 9540a2e2a9c..166989ed77a 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -1639,14 +1639,26 @@ class View {
private function lockPath($path, $type) {
$mount = $this->getMount($path);
if ($mount) {
- $mount->getStorage()->acquireLock($mount->getInternalPath($this->getAbsolutePath($path)), $type, $this->lockingProvider);
+ $mount->getStorage()->acquireLock(
+ $mount->getInternalPath(
+ $this->getAbsolutePath($path)
+ ),
+ $type,
+ $this->lockingProvider
+ );
}
}
private function unlockPath($path, $type) {
$mount = $this->getMount($path);
if ($mount) {
- $mount->getStorage()->releaseLock($mount->getInternalPath($this->getAbsolutePath($path)), $type, $this->lockingProvider);
+ $mount->getStorage()->releaseLock(
+ $mount->getInternalPath(
+ $this->getAbsolutePath($path)
+ ),
+ $type,
+ $this->lockingProvider
+ );
}
}