-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
lib/Crypto/Encryption.php
Outdated
@@ -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')) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
fead3cb
to
632b655
Compare
lib/Crypto/Encryption.php
Outdated
* | ||
* @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) { |
There was a problem hiding this comment.
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>
632b655
to
fd1e1fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Please backport to stable10 (in core repo) |
This change is required so that move
operation executed by transer-ownership
command.
Signed-off-by: Sujith H sharidasan@owncloud.com