diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-11-07 11:19:04 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-11-07 11:19:04 +0100 |
commit | e345697cabd6670e652f4bba7b91269e4efcd794 (patch) | |
tree | c4007ac3f50f13941eec34209e2e0979146b9d84 /lib | |
parent | 88c329b394e9a8cddda65b6e3645f7d6dcff279f (diff) | |
parent | c2a45c1238c63ad97dbbfd1ef29fb70a45a93d09 (diff) | |
download | nextcloud-server-e345697cabd6670e652f4bba7b91269e4efcd794.tar.gz nextcloud-server-e345697cabd6670e652f4bba7b91269e4efcd794.zip |
Merge pull request #11954 from owncloud/enc_stop_uploading_if_private_key_is_missing
Enc stop uploading if private key is missing
Diffstat (limited to 'lib')
-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()); + } } } |