Merge pull request #6220 from owncloud/debug_oracle_errors
cherry-picks from #5884, just for debugging purpose
This commit is contained in:
commit
575a68074f
|
@ -840,32 +840,35 @@ class Util {
|
||||||
// Open enc file handle for binary writing, with same filename as original plain file
|
// Open enc file handle for binary writing, with same filename as original plain file
|
||||||
$encHandle = fopen('crypt://' . $rawPath . '.part', 'wb');
|
$encHandle = fopen('crypt://' . $rawPath . '.part', 'wb');
|
||||||
|
|
||||||
// Move plain file to a temporary location
|
if (is_resource($encHandle)) {
|
||||||
$size = stream_copy_to_stream($plainHandle, $encHandle);
|
// Move plain file to a temporary location
|
||||||
|
$size = stream_copy_to_stream($plainHandle, $encHandle);
|
||||||
|
|
||||||
fclose($encHandle);
|
fclose($encHandle);
|
||||||
fclose($plainHandle);
|
fclose($plainHandle);
|
||||||
|
|
||||||
$fakeRoot = $this->view->getRoot();
|
$fakeRoot = $this->view->getRoot();
|
||||||
$this->view->chroot('/' . $this->userId . '/files');
|
$this->view->chroot('/' . $this->userId . '/files');
|
||||||
|
|
||||||
$this->view->rename($relPath . '.part', $relPath);
|
$this->view->rename($relPath . '.part', $relPath);
|
||||||
|
|
||||||
// set timestamp
|
// set timestamp
|
||||||
$this->view->touch($relPath, $timestamp);
|
$this->view->touch($relPath, $timestamp);
|
||||||
|
|
||||||
$this->view->chroot($fakeRoot);
|
$encSize = $this->view->filesize($relPath);
|
||||||
|
|
||||||
// Add the file to the cache
|
$this->view->chroot($fakeRoot);
|
||||||
\OC\Files\Filesystem::putFileInfo($relPath, array(
|
|
||||||
'encrypted' => true,
|
|
||||||
'size' => $size,
|
|
||||||
'unencrypted_size' => $size,
|
|
||||||
'etag' => $fileInfo['etag']
|
|
||||||
));
|
|
||||||
|
|
||||||
$encryptedFiles[] = $relPath;
|
// Add the file to the cache
|
||||||
|
\OC\Files\Filesystem::putFileInfo($relPath, array(
|
||||||
|
'encrypted' => true,
|
||||||
|
'size' => $encSize,
|
||||||
|
'unencrypted_size' => $size,
|
||||||
|
'etag' => $fileInfo['etag']
|
||||||
|
));
|
||||||
|
|
||||||
|
$encryptedFiles[] = $relPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encrypt legacy encrypted files
|
// Encrypt legacy encrypted files
|
||||||
|
|
|
@ -109,6 +109,9 @@ class OC_Files {
|
||||||
$zip = false;
|
$zip = false;
|
||||||
$filename = $dir . '/' . $files;
|
$filename = $dir . '/' . $files;
|
||||||
$name = $files;
|
$name = $files;
|
||||||
|
if ($xsendfile && OC_App::isEnabled('files_encryption')) {
|
||||||
|
$xsendfile = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
OC_Util::obEnd();
|
OC_Util::obEnd();
|
||||||
if ($zip or \OC\Files\Filesystem::isReadable($filename)) {
|
if ($zip or \OC\Files\Filesystem::isReadable($filename)) {
|
||||||
|
|
|
@ -178,6 +178,10 @@ class Cache {
|
||||||
if ($file['storage_mtime'] == 0) {
|
if ($file['storage_mtime'] == 0) {
|
||||||
$file['storage_mtime'] = $file['mtime'];
|
$file['storage_mtime'] = $file['mtime'];
|
||||||
}
|
}
|
||||||
|
if ($file['encrypted']) {
|
||||||
|
$file['encrypted_size'] = $file['size'];
|
||||||
|
$file['size'] = $file['unencrypted_size'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $files;
|
return $files;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue