|
@@ 731-735 (lines=5) @@
|
| 728 |
|
// Disable proxy to prevent file being encrypted again |
| 729 |
|
\OC_FileProxy::$enabled = false; |
| 730 |
|
|
| 731 |
|
if ($encHandle === false) { |
| 732 |
|
\OCP\Util::writeLog('Encryption library', 'couldn\'t open "' . $rawPath . '", decryption failed!', \OCP\Util::FATAL); |
| 733 |
|
$successful = false; |
| 734 |
|
continue; |
| 735 |
|
} |
| 736 |
|
|
| 737 |
|
// Open plain file handle for binary writing, with same filename as original plain file |
| 738 |
|
$plainHandle = $this->view->fopen($rawPath . '.part', 'wb'); |
|
@@ 739-743 (lines=5) @@
|
| 736 |
|
|
| 737 |
|
// Open plain file handle for binary writing, with same filename as original plain file |
| 738 |
|
$plainHandle = $this->view->fopen($rawPath . '.part', 'wb'); |
| 739 |
|
if ($plainHandle === false) { |
| 740 |
|
\OCP\Util::writeLog('Encryption library', 'couldn\'t open "' . $rawPath . '.part", decryption failed!', \OCP\Util::FATAL); |
| 741 |
|
$successful = false; |
| 742 |
|
continue; |
| 743 |
|
} |
| 744 |
|
|
| 745 |
|
// Move plain file to a temporary location |
| 746 |
|
$size = stream_copy_to_stream($encHandle, $plainHandle); |
|
@@ 747-751 (lines=5) @@
|
| 744 |
|
|
| 745 |
|
// Move plain file to a temporary location |
| 746 |
|
$size = stream_copy_to_stream($encHandle, $plainHandle); |
| 747 |
|
if ($size === 0) { |
| 748 |
|
\OCP\Util::writeLog('Encryption library', 'Zero bytes copied of "' . $rawPath . '", decryption failed!', \OCP\Util::FATAL); |
| 749 |
|
$successful = false; |
| 750 |
|
continue; |
| 751 |
|
} |
| 752 |
|
|
| 753 |
|
fclose($encHandle); |
| 754 |
|
fclose($plainHandle); |