Repository navigation
Encryption - fix moving/copying files between storages - #15628
Conversation
922c78c to
29f320f
Compare
29f320f to
872652b
Compare
There was a problem hiding this comment.
It seems that you rewrote your own copyFromStorage ?
Does this operate only on keys or on the real storage ?
CC @icewind1991
There was a problem hiding this comment.
This operates on the real storage. We need this in order not to bypass the encryption wrapper for the target in line 355. Otherwise we will not write the file encrypted to the target.
There was a problem hiding this comment.
We need to find a better way.
I'm worried not only about code duplication from https://github.com/owncloud/core/blob/master/lib/private/files/storage/common.php#L536 but also there's a risk that if someone fixes common.php, that this class here would be forgotten.
@icewind1991 can you advise on an alternative approach ?
We could move the copy logic into a separate utility method that can be called by both somehow ?
There was a problem hiding this comment.
Maybe it is possible to call fopen here https://github.com/owncloud/core/blob/master/lib/private/files/storage/common.php#L548 in a way that it will go again through all wrappers? But I don't know how this could be done if you are already down at the storage level.
Getting this: => moved to #15688 |
Note: here I setup my OC + keys using the enc2_migration branch, just to be sure. |
|
I don't remember. Let's get #15616 merged first then. |
|
#15616 was just merged. Please rebase to get the latest changes and get more accurate testing 😄 |
|
Well I'll do it myself then test this. |
872652b to
bd49b75
Compare
The external storage bugs are not related to this PR, so I raised them here: #15688 Please have a look at my comment regarding duplicate code before this can be merged. |
|
Fixes #15840 |
|
Needs another loop of rebasing, sorry |
|
And we still have no good solution for the duplicate code 😦 |
|
I will rebase it once #15839 was merged because there is some overlapping. |
830c1e5 to
03284b7
Compare
|
@PVince81 now it is no longer a 1:1 copy from the base storage. I changed the code to also adjust the "encrypted"-flag in the filecache entry if files gets moved between encrypted and un-encrypted storage. Otherwise a unencrypted file can be detected as a legacy encrypted file. PS: Unit tests will come later today 😄 |
There was a problem hiding this comment.
The reason "moveFromStorage" was introduced was to be able to move files when needed.
Assuming that the encryption wrapper is always specified, it would cancel that effort by always doing a copy.
You probably copied this from https://github.com/owncloud/core/blob/master/lib/private/files/storage/common.php. But in many cases it's about the local storage, so the code would be https://github.com/owncloud/core/blob/master/lib/private/files/storage/local.php#L382
Would it possible to add a check "if encryption actually enabled", then do the special logic, else just call the underlying storage's "moveFromStorage" ?
|
Seems like Jenkins don't want to test this branch any longer... I opened a new PR just for Jenkins: #16046 |
|
Would be great to get this reviewed and merged... cc @th3fallen @nickvergessen @DeepDiver1975 |
|
@nickvergessen you can ignore the failing tests... passing tests are here #16046 |
|
rebased to resolve merge conflicts |
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 14 lines...] > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git1028190303737524368.credentials # timeout=10 > git -c core.askpass=true fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse refs/remotes/origin/pr/15628/merge^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/pr/15628/merge^{commit} # timeout=10Checking out Revision f8fac96f774e56a23bb5041677d2728d33beb547 (refs/remotes/origin/pr/15628/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f f8fac96f774e56a23bb5041677d2728d33beb547 > git rev-list 14e482fff3d4ee31e097f19e80a7cdbf2c8e2293 # timeout=10First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILURESetting status of 6e6ec55 to FAILURE with url https://ci.owncloud.org/job/pull-request-analyser-ng-simple/12200/ and message: Build finished.💣 Test FAILed. 💣 |
|
tested and still works as expected 👍 |
f100d60 to
aea734a
Compare
|
A new inspection was created. |
|
rebased again |
|
Refer to this link for build results (access rights to CI server needed): Build result: FAILURE[...truncated 14 lines...] > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10 > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.gitusing GIT_SSH to set credentials using .gitcredentials to set credentials > git config --local credential.helper store --file=/tmp/git5178862980473275824.credentials # timeout=10 > git -c core.askpass=true fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git config --local --remove-section credential # timeout=10 > git rev-parse refs/remotes/origin/pr/15628/merge^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/pr/15628/merge^{commit} # timeout=10Checking out Revision fd0d800602cd3230ecf21932c733fdcdea907eec (refs/remotes/origin/pr/15628/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f fd0d800602cd3230ecf21932c733fdcdea907eec > git rev-list c30a9dafe9b76a0806946fe287572d17defe0624 # timeout=10First time build. Skipping changelog. > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng-simple » SLAVEpull-request-analyser-ng-simple » SLAVE completed with result FAILURESetting status of aea734a to FAILURE with url https://ci.owncloud.org/job/pull-request-analyser-ng-simple/12211/ and message: Build finished.💣 Test FAILed. 💣 |
|
👍 Working fine, tested with SFTP external storage and shared folder (in same OC server) |
Encryption - fix moving/copying files between storages
Encryption - fix moving/copying files between storages

Fix move/copy files between different storages.
fix #15963 (see the issue for concrete steps to test it)
cc @PVince81
Ignore the failing tests, Jenkins doesn't like this branch any more... passing tests are here: #16046