summaryrefslogtreecommitdiffstats
path: root/lib/private/encryption
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-05-13 14:39:27 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-05-13 19:06:23 +0200
commitccbefb6e7506f5ad7cc23c9ae50971f8ea18b463 (patch)
tree908e3dfbc9c21a7e5135167c9976d25e0f56be84 /lib/private/encryption
parent5941e826b8e6005de08fdcb777efb3def5ca8101 (diff)
downloadnextcloud-server-ccbefb6e7506f5ad7cc23c9ae50971f8ea18b463.tar.gz
nextcloud-server-ccbefb6e7506f5ad7cc23c9ae50971f8ea18b463.zip
delete all file keys doesn't need the encryption module as parameter; implement rmdir; getFileKeyDir should also work for part files and complete directories
Diffstat (limited to 'lib/private/encryption')
-rw-r--r--lib/private/encryption/keys/storage.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/private/encryption/keys/storage.php b/lib/private/encryption/keys/storage.php
index 118c8dc920d..6aa00c5b5ee 100644
--- a/lib/private/encryption/keys/storage.php
+++ b/lib/private/encryption/keys/storage.php
@@ -125,10 +125,9 @@ class Storage implements IStorage {
/**
* @inheritdoc
*/
- public function deleteAllFileKeys($path, $encryptionModuleId) {
- $keyDir = $this->getFileKeyDir($encryptionModuleId, $path);
- $path = dirname($keyDir);
- return !$this->view->file_exists($path) || $this->view->deleteAll($path);
+ public function deleteAllFileKeys($path) {
+ $keyDir = $this->getFileKeyDir('', $path);
+ return !$this->view->file_exists($keyDir) || $this->view->deleteAll($keyDir);
}
/**
@@ -208,17 +207,10 @@ class Storage implements IStorage {
* @param string $encryptionModuleId
* @param string $path path to the file, relative to data/
* @return string
- * @throws GenericEncryptionException
- * @internal param string $keyId
*/
private function getFileKeyDir($encryptionModuleId, $path) {
- if ($this->view->is_dir($path)) {
- throw new GenericEncryptionException("file was expected but directory was given: $path");
- }
-
list($owner, $filename) = $this->util->getUidAndFilename($path);
- $filename = $this->util->stripPartialFileExtension($filename);
// in case of system wide mount points the keys are stored directly in the data directory
if ($this->util->isSystemWideMountPoint($filename, $owner)) {