Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-11-04 19:17:29 +0300
committerBjoern Schiessle <schiessle@owncloud.com>2014-11-05 15:05:46 +0300
commitc2a45c1238c63ad97dbbfd1ef29fb70a45a93d09 (patch)
tree765ba6ffff4b12f537dff72a4132113ba77166e8 /lib/private/connector/sabre/file.php
parent0580c232d72123ca7e3c675ed73268099d00d185 (diff)
throw exception if private key is missing
Diffstat (limited to 'lib/private/connector/sabre/file.php')
-rw-r--r--lib/private/connector/sabre/file.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 903c3447b56..dc036c1adca 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -100,6 +100,8 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
} catch (\OCP\Files\LockNotAcquiredException $e) {
// the file is currently being written to by another process
throw new OC_Connector_Sabre_Exception_FileLocked($e->getMessage(), $e->getCode(), $e);
+ } catch (\OCA\Encryption\Exceptions\EncryptionException $e) {
+ throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
}
// if content length is sent by client:
@@ -152,7 +154,11 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
if (\OC_Util::encryptedFiles()) {
throw new \Sabre\DAV\Exception\ServiceUnavailable();
} else {
- return $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
+ try {
+ return $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
+ } catch (\OCA\Encryption\Exceptions\EncryptionException $e) {
+ throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
+ }
}
}