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

Change required for move operation #8

Merged
merged 1 commit into from
Jul 31, 2017

Conversation

sharidas
Copy link
Contributor

This change is required so that move
operation executed by transer-ownership
command.

Signed-off-by: Sujith H sharidasan@owncloud.com

@@ -189,7 +189,23 @@ public function begin($path, $user, $mode, array $header, array $accessList) {
// always use the version from the original file, also part files
// need to have a correct version number if they get moved over to the
// final location
$this->version = (int)$this->keyManager->getVersion($this->stripPartFileExtension($path), new View());
if (\OC::$server->getSession()->exists('renameFile')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

while this might have worked for confirming the fix, we need a clean approach to detect renames.

Storing in the session is an absolute no go. Imagine if there are concurrent file operations where one is a rename, the value stored in the session would affect any other parallel unrelated file transfers and would likely destroy the known universe

Copy link
Contributor

Choose a reason for hiding this comment

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

please check this location https://github.com/owncloud/core/blob/master/lib/private/Files/Storage/Wrapper/Encryption.php#L652, it is likely more suitable for the fix

@sharidas sharidas force-pushed the transfer-ownership-masterkey-task branch from fead3cb to 632b655 Compare July 28, 2017 04:57
*
* @return array $header contain data as key-value pairs which should be
* written to the header, in case of a write operation
* or if no additional data is needed return a empty array
*/
public function begin($path, $user, $mode, array $header, array $accessList) {
public function begin($path, $user, $mode, array $header, array $accessList, $renameFile = false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Brought a new argument to begin. There are respective changes owncloud/core#28107. Made changes to encryptions fopen. Also to the "ocencryption" context.

This change is required so that move
operation executed by transer-ownership
command.

Signed-off-by: Sujith H <sharidasan@owncloud.com>
@sharidas sharidas force-pushed the transfer-ownership-masterkey-task branch from 632b655 to fd1e1fa Compare July 28, 2017 10:13
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.

👍

@PVince81 PVince81 merged commit 4fdfce0 into master Jul 31, 2017
@PVince81 PVince81 deleted the transfer-ownership-masterkey-task branch July 31, 2017 06:44
@PVince81
Copy link
Contributor

Please backport to stable10 (in core repo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants