[Pkg-owncloud-commits] [owncloud] 210/457: Use md5 for lock key

David Prévot taffit at moszumanska.debian.org
Sun Jun 28 20:06:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 0775e9c1ca95a3f93b1069610fd89a0801f9f897
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed May 13 11:36:40 2015 +0200

    Use md5 for lock key
---
 lib/private/files/storage/common.php |  4 ++--
 lib/private/files/view.php           | 16 ++++++++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php
index 0450117..1c54f7c 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 9540a2e..166989e 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
+			);
 		}
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list