diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-11-04 17:17:29 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-11-05 13:05:46 +0100 |
commit | c2a45c1238c63ad97dbbfd1ef29fb70a45a93d09 (patch) | |
tree | 765ba6ffff4b12f537dff72a4132113ba77166e8 /lib/private/connector | |
parent | 0580c232d72123ca7e3c675ed73268099d00d185 (diff) | |
download | nextcloud-server-c2a45c1238c63ad97dbbfd1ef29fb70a45a93d09.tar.gz nextcloud-server-c2a45c1238c63ad97dbbfd1ef29fb70a45a93d09.zip |
throw exception if private key is missing
Diffstat (limited to 'lib/private/connector')
-rw-r--r-- | lib/private/connector/sabre/file.php | 8 |
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()); + } } } |