summaryrefslogtreecommitdiffstats
path: root/lib/private/connector
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-09-23 00:49:30 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-09-23 00:49:30 +0200
commitf970c81b1e68fa21d93d0f74a84bde300a7470af (patch)
treed34c27655eef10f399c2e4b2de603fea05426193 /lib/private/connector
parent051ed93e24cfba0228b01027dec4e6bcf082d0af (diff)
parent470c25eff49c38cb1a3ffbb2b0ce4007093bf26e (diff)
downloadnextcloud-server-f970c81b1e68fa21d93d0f74a84bde300a7470af.tar.gz
nextcloud-server-f970c81b1e68fa21d93d0f74a84bde300a7470af.zip
Merge pull request #11215 from owncloud/dav-throwwhendeletefailed
WebDAV now throws 403 when deletion did not work
Diffstat (limited to 'lib/private/connector')
-rw-r--r--lib/private/connector/sabre/directory.php5
-rw-r--r--lib/private/connector/sabre/file.php6
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php
index 9cd7c553f0b..597fbdae0cc 100644
--- a/lib/private/connector/sabre/directory.php
+++ b/lib/private/connector/sabre/directory.php
@@ -192,7 +192,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node
throw new \Sabre\DAV\Exception\Forbidden();
}
- $this->fileView->rmdir($this->path);
+ if (!$this->fileView->rmdir($this->path)) {
+ // assume it wasn't possible to remove due to permission issue
+ throw new \Sabre\DAV\Exception\Forbidden();
+ }
}
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 246749903b3..903c3447b56 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -167,7 +167,11 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
if (!$this->info->isDeletable()) {
throw new \Sabre\DAV\Exception\Forbidden();
}
- $this->fileView->unlink($this->path);
+
+ if (!$this->fileView->unlink($this->path)) {
+ // assume it wasn't possible to delete due to permissions
+ throw new \Sabre\DAV\Exception\Forbidden();
+ }
// remove properties
$this->removeProperties();