Stream writing improved: working with dolphin + kate, gedit & nautilus give errors, suspect those issues are clientside

.part file paths fixed in stream{}
This commit is contained in:
Sam Tuke 2013-04-23 17:36:35 +02:00
parent 4aa80d02be
commit c6bfc7315b
3 changed files with 7 additions and 22 deletions

View File

@ -118,9 +118,6 @@ class Proxy extends \OC_FileProxy {
// Decrypt the keyfile
$plainKey = Crypt::multiKeyDecrypt( $encKeyfile, $shareKey, $privateKey );
// trigger_error("\$shareKey = $shareKey");
// trigger_error("\$plainKey = $plainKey");
} else {
@ -207,8 +204,6 @@ class Proxy extends \OC_FileProxy {
$plainKeyfile = Crypt::multiKeyDecrypt( $encKeyfile, $shareKey, $privateKey );
$plainData = Crypt::symmetricDecryptFileContent( $data, $plainKeyfile );
// trigger_error("PLAINDATA = ". var_export($plainData, 1));
} elseif (
Crypt::mode() == 'server'

View File

@ -86,6 +86,9 @@ class Stream {
// rawPath is relative to the data directory
$this->rawPath = $this->userId . '/files/' . $this->relPath;
// Fix .part filenames
$this->rawPath = Keymanager::fixPartialFilePath( $this->rawPath );
if (
dirname( $this->rawPath ) == 'streams'
and isset( self::$sourceStreams[basename( $this->rawPath )] )
@ -257,11 +260,6 @@ class Stream {
$this->plainKey = Crypt::multiKeyDecrypt( $this->encKeyfile, $shareKey, $privateKey );
// trigger_error( '$this->relPath = '.$this->relPath );
// trigger_error( '$this->userId = '.$this->userId);
// trigger_error( '$this->encKeyfile = '.$this->encKeyfile );
// trigger_error( '$this->plainKey1 = '.var_export($this->plainKey, 1));
return true;
} else {
@ -352,12 +350,6 @@ class Stream {
// Save the sharekeys
Keymanager::setShareKeys( $view, $this->relPath, $this->encKeyfiles['keys'] );
// trigger_error( "\$this->encKeyfiles['data'] = ".$this->encKeyfiles['data'] );
// trigger_error( '$this->relPath = '.$this->relPath );
// trigger_error( '$this->userId = '.$this->userId);
// trigger_error( '$this->encKeyfile = '.var_export($this->encKeyfiles, 1) );
// trigger_error( '$this->plainKey2 = '.var_export($this->plainKey, 1));
// If extra data is left over from the last round, make sure it
// is integrated into the next 6126 / 8192 block
if ( $this->writeCache ) {
@ -420,7 +412,7 @@ class Stream {
// Clear $data ready for next round
$data = '';
//
} else {
// Read the chunk from the start of $data
@ -428,8 +420,6 @@ class Stream {
$encrypted = $this->preWriteEncrypt( $chunk, $this->plainKey );
//trigger_error("\$encrypted = $encrypted");
// Write the data chunk to disk. This will be
// attended to the last data chunk if the file
// being handled totals more than 6126 bytes
@ -515,9 +505,9 @@ class Stream {
\OC\Files\Filesystem::putFileInfo( $this->relPath, array( 'encrypted' => true, 'size' => $this->size ), '' );
}
return fclose( $this->handle );
return fclose( $this->handle );
}
}

View File

@ -492,7 +492,7 @@ class Util {
* @note Encryption is recursive
*/
public function encryptAll( $publicKey, $dirPath, $legacyPassphrase = null, $newPassphrase = null ) {
if ( $found = $this->findEncFiles( $dirPath ) ) {
// Disable proxy to prevent file being encrypted twice