Skip to content

properly cancel a Paginated Results operation in order to avoid protocol... - #10527

Merged
blizzz merged 5 commits into
masterfrom
fix-10526
Oct 9, 2014
Merged

blizzz merged 5 commits into
masterfrom
fix-10526

Conversation

@blizzz

@blizzz blizzz commented Aug 19, 2014

Copy link
Copy Markdown
Contributor

... errors, fixes #10526

This is mostly an issue with OpenLDAP, AD worked with the old approach. But now we are also following the RFC more nicely.

How to test?

  1. Have an OpenLDAP ready with more than 20 users
  2. Put the test script into your ownCloud root: https://gist.github.com/blizzz/1b4998422823f7a2d3af
  3. Run the test script from command line: php -f testCancel.php 2> data/owncloud.log

On master with OpenLDAP it will fail with this output:

Step 1: fetching 10 users succeeded
Step 2: reading attribute done
Validation: cancelling Paged Search failed! Users found:  0

With AD, or with OpenLDAP and this fix, it will succeed, output like this:

Step 1: fetching 10 users succeeded
Step 2: reading attribute done
Validation: cancelling Paged Search succeeded :) !

If possible, please also test with 389 Directory Server, OpenDJ, Oracle Internet Directory, Apache DS.

@blizzz blizzz added this to the 2014-sprint-04-current milestone Sep 18, 2014
@craigpg craigpg modified the milestones: 2014-sprint-05-current, 2014-sprint-04 Sep 29, 2014
@blizzz

blizzz commented Sep 30, 2014

Copy link
Copy Markdown
Contributor Author

Please review and test @jnfrmarks @Xenopathic @frankuit @razyr @digital-wonderland or others

This is necessary for #11161 and in order to fix #10513 for LDAP users.

cc @craigpg

@blizzz blizzz changed the title [WIP] properly cancel a Paginated Results operation in order to avoid protocol... properly cancel a Paginated Results operation in order to avoid protocol... Sep 30, 2014
@LukasReschke

Copy link
Copy Markdown
Contributor

Marking as gold since #10513 is gold.

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

Looks like Samba4 doesn't suffer from this bug. Unfortunately this means I cannot test the fix, but at least it didn't break when applied. Code looks good though, so it's 👍 from me.

@blizzz

blizzz commented Oct 1, 2014

Copy link
Copy Markdown
Contributor Author

Very good @Xenopathic, thank you for testing & reviewing!

@scrutinizer-notifier

Copy link
Copy Markdown

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

@ghost

ghost commented Oct 1, 2014

Copy link
Copy Markdown

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

@ghost

ghost commented Oct 6, 2014

Copy link
Copy Markdown

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

@PVince81

PVince81 commented Oct 8, 2014

Copy link
Copy Markdown
Contributor

I tried with both master and this branch, and the test script gives the success message for both.
Do I need to have exactly 20 users ? I currently have 102

@PVince81

PVince81 commented Oct 8, 2014

Copy link
Copy Markdown
Contributor

When testing with OpenLDAP

@PVince81

PVince81 commented Oct 8, 2014

Copy link
Copy Markdown
Contributor

Too bad we don't have unit tests that run directly against a LDAP server, like we have for different external storage backends. Will raise a ticket for that.

@PVince81

PVince81 commented Oct 8, 2014

Copy link
Copy Markdown
Contributor

Raised here: #11488

@blizzz

blizzz commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

I tried with both master and this branch, and the test script gives the success message for both.
Do I need to have exactly 20 users ? I currently have 102

No, you need at least 20, but there is no upper bound. You are on PHP > 5.3?

@PVince81

PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

Yes, PHP 5.4.20

@PVince81

PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

Never mind, I managed to make it work.
The key is that you need to clear the cache manually (/tmp/owncloud-xxxx folder) and run cron.php after switching the branch to refresh the config.

Before this fix: cancelling failed
After this fix: cancelling works

👍

@blizzz

blizzz commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

Splendid

@PVince81

PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

@owncloud-bot retest this please

@ghost

ghost commented Oct 9, 2014

Copy link
Copy Markdown

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

blizzz added a commit that referenced this pull request Oct 9, 2014
properly cancel a Paginated Results operation in order to avoid protocol...
@blizzz
blizzz merged commit cc717c2 into master Oct 9, 2014
@blizzz
blizzz deleted the fix-10526 branch October 9, 2014 10:40
@blizzz

blizzz commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

Needs a backport to stable7 and 6. @karlitschek confirm?

@karlitschek

Copy link
Copy Markdown
Contributor

Yes. please backport

blizzz added a commit that referenced this pull request Oct 9, 2014
properly cancel a Paginated Results operation in order to avoid protocol errors, fixes #10526

abandon ongoing paged search before starting a new one

abandond paged search only if PHP supports them

init a new paged search on read operations to satisfy OpenLDAP

make scrutinizer happy, very minor changes
@blizzz

blizzz commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

backport to stable7 f0c4347

blizzz added a commit that referenced this pull request Oct 9, 2014
properly cancel a Paginated Results operation in order to avoid protocol errors, fixes #10526

abandon ongoing paged search before starting a new one

abandond paged search only if PHP supports them

init a new paged search on read operations to satisfy OpenLDAP

make scrutinizer happy, very minor changes

Conflicts:
	apps/user_ldap/lib/access.php
	apps/user_ldap/lib/ildapwrapper.php
@blizzz

blizzz commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

backport to stable6 94d5f9e

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 15, 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.

Paged Results search operation not properly cancelled

8 participants