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

[stable9] Fixed dynamic group ldap access #24950

Merged
merged 6 commits into from
Jun 10, 2016

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented Jun 1, 2016

Backport of #23450 to stable9

Please review and test @owncloud/ldap @owncloud/qa @alexweirig

alexweirig and others added 4 commits June 1, 2016 16:27
getUserGroups:
Using $userDN instead of $uid to query LDAP
Converting groupDN to group name using API instead of substring
Removing cache processing at the end of the method
added back the cache processing and fixed
spaces -> tab conversion
@PVince81 PVince81 added this to the 9.0.3-current-maintenance milestone Jun 1, 2016
@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @alexweirig, @blizzz and @leo-b to be potential reviewers

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 1, 2016

Fixes #23081

@@ -530,11 +531,12 @@ public function getUserGroups($uid) {
}

if(isset($this->cachedGroupsByMember[$uid])) {
$groups = $this->cachedGroupsByMember[$uid];
$groups[] = $this->cachedGroupsByMember[$uid];
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks wrong, do you mean array_merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nickvergessen it was like this in the original PR, so probably intentional ?

@alexweirig can you comment (I believe it was your change)

Copy link
Contributor

Choose a reason for hiding this comment

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

@PVince81
yes, that's what seems to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did some debugging to check the values of the arrays. It seems that in the cases I tested this part of the code never gets executed, probably because the user's groups are already cached.

I suppose it is very rare that this code path will be reached. For that one would have to call getUserGroups for multiple users within the same PHP request.

@nickvergessen is right that this needs an array_merge. I'll make a PR to master.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

even the cron jobs don't go there

@alexweirig
Copy link
Contributor

@PVince81
Hi Vincent,
could you please confirm this is the right approach to test this?

  1. I download owncloud 9.0.2
  2. I apply the patch
  3. Test if everything is OK

or do I need to download a different version of owncloud?

Many thanks in advance

Alex

@alexweirig
Copy link
Contributor

@PVince81
do we need to apply both the patch and the diff file?

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 2, 2016

@alexweirig you could download the daily stable9 build and then apply the patched from this PR on top of it. This way there is less risk of conflicts.

@alexweirig
Copy link
Contributor

@PVince81 @blizzz
I downloaded 9.0.2 and applied the .patch file to the code.

I then tested the dynamic group memberships and everything seems to work just as I expected.
The users list is shown with the dynamic group memberships, when I click on a dynamic group, I see the users that belong to the group.

Code is OK for me!

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 2, 2016

@alexweirig thanks, counting as thumbs up 👍

@alexweirig
Copy link
Contributor

@PVince81
Yes, please 👍

BTW: I can't apply the patch to the daily build because the user_ldap application has completely changed ... The php have moved and the patch doesn't find them anymore.
But wasn't this patch supposed to be for the backporting to 9.0.x?

@alexweirig
Copy link
Contributor

@PVince81
I also tested the daily stable build without applying the patch (as the patch doesn't work) and everything the dynamic groups are also working as expected.
👍

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 6, 2016

With daily stable you mean the master one ? (9.1)

The patch of this PR is intended to be used for 9.0.x

@alexweirig
Copy link
Contributor

@PVince81
Agreed, I tested both:

  • daily master thus 9.1 which seems to already include the patched version
  • patch applied to 9.0.x

So this looks good

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 6, 2016

I suggest we merge this then directly fix this piece #24950 (comment) both on master + backport to 9.0

@nickvergessen

@nickvergessen
Copy link
Contributor

Well fine by me, but I think it needs fixing

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 8, 2016

PR for master for missing array_merge: #25024

I pushed the commit here too: b37f2e2

@alexweirig mind redoing a test on 9.0 with that extra commit ?

@PVince81
Copy link
Contributor Author

#24950 (comment) fixed @nickvergessen

@PVince81 PVince81 merged commit 9edcdb3 into stable9 Jun 10, 2016
@PVince81 PVince81 deleted the stable9-fixdynamicldapgroupaccess branch June 10, 2016 09:07
@lock
Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

5 participants