diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/filesystem.php | 2 | ||||
-rw-r--r-- | lib/private/files/storage/wrapper/encryption.php | 8 | ||||
-rw-r--r-- | lib/private/updater.php | 11 |
3 files changed, 14 insertions, 7 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index 212deb24b7a..14757c83950 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -382,7 +382,7 @@ class Filesystem { if (is_null($userObject)) { \OCP\Util::writeLog('files', ' Backends provided no user object for ' . $user, \OCP\Util::ERROR); - throw new \OC\User\NoUserException(); + throw new \OC\User\NoUserException('Backends provided no user object for ' . $user); } $homeStorage = \OC_Config::getValue('objectstore'); diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 056f823c18b..8d1f80c53c0 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -349,7 +349,8 @@ class Encryption extends Wrapper { if ($this->util->isExcluded($fullPath) === false) { $size = $unencryptedSize = 0; - $targetExists = $this->file_exists($path); + $realFile = $this->util->stripPartialFileExtension($path); + $targetExists = $this->file_exists($realFile); $targetIsEncrypted = false; if ($targetExists) { // in case the file exists we require the explicit module as @@ -605,8 +606,9 @@ class Encryption extends Wrapper { */ protected function getHeader($path) { $header = ''; - if ($this->storage->file_exists($path)) { - $handle = $this->storage->fopen($path, 'r'); + $realFile = $this->util->stripPartialFileExtension($path); + if ($this->storage->file_exists($realFile)) { + $handle = $this->storage->fopen($realFile, 'r'); $firstBlock = fread($handle, $this->util->getHeaderSize()); fclose($handle); if (substr($firstBlock, 0, strlen(Util::HEADER_START)) === Util::HEADER_START) { diff --git a/lib/private/updater.php b/lib/private/updater.php index bd9e8a65363..00c6569a52f 100644 --- a/lib/private/updater.php +++ b/lib/private/updater.php @@ -189,20 +189,25 @@ class Updater extends BasicEmitter { $this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, array('app' => 'core')); } + $success = true; try { $this->doUpgrade($currentVersion, $installedVersion); } catch (\Exception $exception) { - $this->emit('\OC\Updater', 'failure', array($exception->getMessage())); + \OCP\Util::logException('update', $exception); + $this->emit('\OC\Updater', 'failure', array(get_class($exception) . ': ' .$exception->getMessage())); + $success = false; } - $this->emit('\OC\Updater', 'updateEnd'); + $this->emit('\OC\Updater', 'updateEnd', array($success)); - if(!$wasMaintenanceModeEnabled) { + if(!$wasMaintenanceModeEnabled && $success) { $this->config->setSystemValue('maintenance', false); $this->emit('\OC\Updater', 'maintenanceDisabled'); } else { $this->emit('\OC\Updater', 'maintenanceActive'); } + + return $success; } /** |