summaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-06-09 14:01:07 +0200
committerRobin Appelman <icewind@owncloud.com>2015-06-15 14:32:29 +0200
commita4f808b11d2e49e4c73a910a12574df177b2f5c7 (patch)
tree24089598d56220922135dd90b64c0073899bf031 /lib/private/files/view.php
parent7d72f7d8ce3c15e25382c6121c374de92fe84775 (diff)
downloadnextcloud-server-a4f808b11d2e49e4c73a910a12574df177b2f5c7.tar.gz
nextcloud-server-a4f808b11d2e49e4c73a910a12574df177b2f5c7.zip
properly unlock in case of failed fopen
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index f410fdc8c00..c5494b9b3ed 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -999,7 +999,7 @@ class View {
throw $e;
}
- if ((in_array('write', $hooks) || in_array('delete', $hooks)) && $operation !== 'fopen') {
+ if ((in_array('write', $hooks) || in_array('delete', $hooks)) && ($operation !== 'fopen' || $result === false)) {
$this->changeLock($path, ILockingProvider::LOCK_SHARED);
}
@@ -1013,7 +1013,7 @@ class View {
$this->updater->update($path, $extraParam);
}
- if ($operation === 'fopen' and $result) {
+ if ($operation === 'fopen' and is_resource($result)) {
$result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) {
if (in_array('write', $hooks)) {
$this->unlockFile($path, ILockingProvider::LOCK_EXCLUSIVE);