Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increment required only when encryption is enabled #28820

Merged
merged 1 commit into from
Sep 1, 2017

Conversation

sharidas
Copy link
Contributor

@sharidas sharidas commented Aug 28, 2017

Increment to files in filecache is required only when
encryption is enabled. Else use the version as it is.

Signed-off-by: Sujith H [email protected]

Description

When encryption is not enabled then no need to go through each and every step in encryption wrapper's fopen. Instead we can get another storage wrapper's fopen handler.

Related Issue

#28780

Motivation and Context

This would help resolve the exceptions thrown in the logs.

How Has This Been Tested?

  • Create external storage with SFTP
  • Create a folder test under shared folder.
  • upload a file under test
  • Delete the test folder
  • Try to access the test folder from the trash
  • No exception logs found

Also I have noted that during verification on my local machine the storage passes to local storage from the encryption wrapper ( when no encryption is enabled ).

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@sharidas sharidas force-pushed the fix-errorlogs-encryptionwrapper branch from b3c48db to 3f7dacf Compare August 28, 2017 14:02
@sharidas sharidas changed the title Return handler of storage wrapper when no encyption enabled Return from encryption wrapper fopen when no encryption enabled Aug 28, 2017
@PVince81
Copy link
Contributor

One reason why we still set the encryption wrapper even when encryption is disabled is mostly because we want to be able to detect formerly encrypted files and avoid sending these back.

So if we want to add such bypass we might need to at least put it after the encryption check, which might be when reading the header.

@sharidas sharidas force-pushed the fix-errorlogs-encryptionwrapper branch from 3f7dacf to 6b62edf Compare August 29, 2017 12:16
@@ -937,9 +943,13 @@ protected function getHeader($path) {
// if the header was empty we have to check first if it is a encrypted file at all
// We would do query to filecache only if we know that entry in filecache exists
$info = $this->getCache()->get($path);
$encryptionModule = '';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made alterations at the getHeader method. The intention here was to pass encryption module wrapped in array if encryption is enabled. And this value is later used https://github.com/owncloud/core/pull/28820/files#diff-938b56891f3079e628cfda1c331911b7R381 to call different storage's fopen. I hope this is the same header which is mentioned at #28820 (comment)

@sharidas sharidas self-assigned this Aug 29, 2017
@sharidas sharidas added this to the QA milestone Aug 29, 2017
@sharidas sharidas force-pushed the fix-errorlogs-encryptionwrapper branch 4 times, most recently from ec8f695 to dd13bd0 Compare August 30, 2017 12:00
@sharidas sharidas changed the title Return from encryption wrapper fopen when no encryption enabled Increment required only when encryption is enabled Aug 30, 2017
@SergioBertolinSG
Copy link
Contributor

I see #28780 fixed here.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 code looks fine.

As discussed it would be good to adjust the trashbin tests to verify that the restored file's contents matches before deletion, and have this test run for encryption too (some encryption tests are disabled with trashbin)

Please also retest versions: restoring or downloading older versions of a file must still work on home and external storage

@sharidas sharidas force-pushed the fix-errorlogs-encryptionwrapper branch from a710404 to 1485064 Compare September 1, 2017 06:15
Increment to files in filecache is required only when
encryption is enabled. Else use the version as it is.

Signed-off-by: Sujith H <[email protected]>
@sharidas sharidas force-pushed the fix-errorlogs-encryptionwrapper branch from 1485064 to 98680b0 Compare September 1, 2017 07:36
@SergioBertolinSG SergioBertolinSG self-requested a review September 1, 2017 08:00
Copy link
Contributor

@SergioBertolinSG SergioBertolinSG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration tests part is ok

@sharidas
Copy link
Contributor Author

sharidas commented Sep 1, 2017

Verified that transfer ownership works with this change. Verified that upon deletion of the file after transfer, made some update, the versions are restored.

@PVince81 PVince81 merged commit 299905a into master Sep 1, 2017
@PVince81 PVince81 deleted the fix-errorlogs-encryptionwrapper branch September 1, 2017 10:21
@PVince81
Copy link
Contributor

PVince81 commented Sep 1, 2017

@sharidas please backport to stable10

@sharidas
Copy link
Contributor Author

sharidas commented Sep 1, 2017

Backport : #28880

@felixboehm felixboehm removed this from the QA milestone Sep 4, 2017
@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants