Skip to content

always create a new instance of the encryption module - #15616

Merged
PVince81 merged 1 commit into
masterfrom
enc_stream_copy
Apr 17, 2015
Merged

PVince81 merged 1 commit into
masterfrom
enc_stream_copy

Conversation

@schiessle

Copy link
Copy Markdown
Contributor

make sure that we have two differnt instances of the encryption module if we do a stream_copy and read and write a encrypted stream at the same file. This was solved by regitsering a closure instead of a instance of the encryption module so that we can create a new instance on every getEncryptionModule() call.

cc @DeepDiver1975 @PVince81 @th3fallen

@schiessle schiessle added this to the 8.1-current milestone Apr 14, 2015
Comment thread lib/private/encryption/manager.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe be more precise and say that the passed callback function must return an encryption module instance.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed

@PVince81

Copy link
Copy Markdown
Contributor

Steps: enable encryption, go to admin page directly, got this:

{"reqId":"ZhRoZPcpDSl4yBkm\/95m","remoteAddr":"127.0.0.1","app":"PHP","message":"Call to undefined method Closure::getId() at \/srv\/www\/htdocs\/owncloud\/settings\/admin.php#94","level":3,"time":"2015-04-14T15:09:51+00:00","method":"GET","url":"\/owncloud\/index.php\/settings\/admin"}

@PVince81

Copy link
Copy Markdown
Contributor

Moving file in and out of a shared folder as recipient works, which is what this PR fixes 👍

However while testing I found that if I move a file as owner into a share, the share keys aren't created for the recipients, raised here: #15619

@schiessle

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@ghost

ghost commented Apr 15, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11526/

Build result: FAILURE

[...truncated 81 lines...] > git config --local --remove-section credential # timeout=10 > 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/git3550067960847430501.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/15616/merge^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/pr/15616/merge^{commit} # timeout=10Checking out Revision c3d5f48196e47c588fda360b76577fe725bbc909 (refs/remotes/origin/pr/15616/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f c3d5f48196e47c588fda360b76577fe725bbc909 > git rev-list c3d5f48196e47c588fda360b76577fe725bbc909 # timeout=10 > 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 e7e72ac to FAILURE with url https://ci.owncloud.org/job/pull-request-analyser-ng-simple/11526/ and message: Merged build finished.
💣 Test FAILed. 💣

nooo432

@PVince81

Copy link
Copy Markdown
Contributor

Unit tests fail (sqlite):

04:35:32 1) Test\Encryption\ManagerTest::testManagerIsDisabledIfDisabledButModules
04:35:32 Argument 1 passed to OC\Encryption\Manager::registerEncryptionModule() must be callable, object given, called in /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php on line 30 and defined
04:35:32 
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/lib/private/encryption/manager.php:67
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php:30
04:35:32 
04:35:32 2) Test\Encryption\ManagerTest::testModuleRegistration
04:35:32 Argument 1 passed to OC\Encryption\Manager::registerEncryptionModule() must be callable, object given, called in /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php on line 53 and defined
04:35:32 
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/lib/private/encryption/manager.php:67
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php:53
04:35:32 
04:35:32 3) Test\Encryption\ManagerTest::testModuleUnRegistration
04:35:32 Argument 1 passed to OC\Encryption\Manager::registerEncryptionModule() must be callable, object given, called in /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php on line 65 and defined
04:35:32 
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/lib/private/encryption/manager.php:67
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php:65
04:35:32 
04:35:32 4) Test\Encryption\ManagerTest::testGetEncryptionModuleUnknown
04:35:32 Argument 1 passed to OC\Encryption\Manager::registerEncryptionModule() must be callable, object given, called in /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php on line 84 and defined
04:35:32 
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/lib/private/encryption/manager.php:67
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php:84
04:35:32 
04:35:32 5) Test\Encryption\ManagerTest::testGetEncryptionModule
04:35:32 Argument 1 passed to OC\Encryption\Manager::registerEncryptionModule() must be callable, object given, called in /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php on line 96 and defined
04:35:32 
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/lib/private/encryption/manager.php:67
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php:96
04:35:32 
04:35:32 6) Test\Encryption\ManagerTest::testGetDefaultEncryptionModule
04:35:32 Argument 1 passed to OC\Encryption\Manager::registerEncryptionModule() must be callable, object given, called in /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php on line 109 and defined
04:35:32 
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/lib/private/encryption/manager.php:67
04:35:32 /var/jenkins/workspace/pull-request-analyser-ng-simple@4/label/SLAVE/tests/lib/encryption/managertest.php:109
04:35:32 

@schiessle

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

1 similar comment
@schiessle

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@ghost

ghost commented Apr 15, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11542/
🚀 Test PASSed.🚀
chuck

@schiessle

Copy link
Copy Markdown
Contributor Author

need second reviewer @DeepDiver1975 @th3fallen @nickvergessen Thanks!

@th3fallen

Copy link
Copy Markdown
Contributor

needs rebase....

@schiessle

Copy link
Copy Markdown
Contributor Author

rebased

@schiessle

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@ghost

ghost commented Apr 16, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11583/
🚀 Test PASSed.🚀
chuck

Comment thread lib/private/encryption/manager.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You execute the callback, so IEncryptionModule is still correct

@schiessle

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@DeepDiver1975

Copy link
Copy Markdown
Contributor

needs rebase - thx

Comment thread lib/private/encryption/manager.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

return call_user_func($this->encryptionModules[$defaultModuleId]['callback']);

@schiessle
schiessle force-pushed the enc_stream_copy branch 2 times, most recently from c787b38 to c097e88 Compare April 17, 2015 08:13
@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 2 new issues, 2 updated code elements

@schiessle

Copy link
Copy Markdown
Contributor Author

@owncloud-bot retest this please

@nickvergessen

Copy link
Copy Markdown
Contributor

👍 once jenkins goes green

@ghost

ghost commented Apr 17, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/11602/
🚀 Test PASSed.🚀
chuck

@PVince81

Copy link
Copy Markdown
Contributor

Greeeeen. Merging

PVince81 pushed a commit that referenced this pull request Apr 17, 2015
always create a new instance of the encryption module
@PVince81
PVince81 merged commit aef6ecd into master Apr 17, 2015
@PVince81
PVince81 deleted the enc_stream_copy branch April 17, 2015 09:32
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 12, 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