diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-24 22:43:46 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-24 22:43:46 +0100 |
commit | b966fc2233b387f8034cafc61a920282e1f6a3b1 (patch) | |
tree | 81caf05e74eb8a605adea85daba2fc42a0e4e117 /lib | |
parent | b8812c8cba81d6ee07f510428e8c25ee3d7391eb (diff) | |
parent | 3d9863febcdc0526cee96a7cc57cc6633313bc9d (diff) | |
download | nextcloud-server-b966fc2233b387f8034cafc61a920282e1f6a3b1.tar.gz nextcloud-server-b966fc2233b387f8034cafc61a920282e1f6a3b1.zip |
Merge pull request #23545 from owncloud/issue-17144-lock-mount-point-on-removal
Lock the mountpoint while removing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/view.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 52be8a7e226..4421a016356 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -269,17 +269,21 @@ class View { // cut of /user/files to get the relative path to data/user/files $pathParts = explode('/', $path, 4); $relPath = '/' . $pathParts[3]; + $this->lockFile($relPath, ILockingProvider::LOCK_SHARED, true); \OC_Hook::emit( Filesystem::CLASSNAME, "umount", array(Filesystem::signal_param_path => $relPath) ); + $this->changeLock($relPath, ILockingProvider::LOCK_EXCLUSIVE, true); $result = $mount->removeMount(); + $this->changeLock($relPath, ILockingProvider::LOCK_SHARED, true); if ($result) { \OC_Hook::emit( Filesystem::CLASSNAME, "post_umount", array(Filesystem::signal_param_path => $relPath) ); } + $this->unlockFile($relPath, ILockingProvider::LOCK_SHARED, true); return $result; } else { // do not allow deleting the storage's root / the mount point |