Uh oh!
There was an error while loading. Please reload this page.
resolve user and groups in nested groups first before filtering the results - #14464
Merged
Conversation
blizzzforce-pushed
the
fix/noid/ldap-nested-group-filter
branch
from
March 5, 2019 00:14
1e00d56 to
09357b8CompareMemberAuthor
|
MorrisJobke
commented
Mar 5, 2019
Member
Merged. |
Currently groupsMatchFilter is called before nested groups are resolved. This basicly breaks this feature since it is not possible to inherit membership in a group from another group. Minimal example: Group filter: (&(objectClass=group),(cn=nextcloud)) Nested groups: enabled cn=nextcloud,ou=Nextcloud,ou=groups,dn=company,dn=local objectClass: group cn=IT,ou=groups,dn=company,dn=local objectClass: group memberOf: cn=nextcloud,ou=Nextcloud,ou=groups,dn=company,dn=local cn=John Doe,ou=users,dn=company,dn=local objectClass: person memberOf: cn=IT,ou=groups,dn=company,dn=local Since 'cn=IT,ou=groups,dn=company,dn=local' doesn't match the group filter, John wouldn't be a member of group 'nextcloud'. This patch fixes this by filtering the groups after all nested groups have been collected. If nested groups is disabled the result will be the same as without this patch. Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
The previous patch fixed the problem only for one level of indirection because groupsMatchFilter() had been applied on each recursive call (and thus there would be no second level if the first level fails the check). This new implementation replaces the recursive call with a stack that iterates all nested groups before filtering with groupsMatchFilter(). Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
Nested groups are now cached in a CappedMemoryCache object to reduce queries to the LDAP backend. Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
…anymore. Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
and also consolidate logic in one method Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
blizzzforce-pushed
the
fix/noid/ldap-nested-group-filter
branch
3 times, most recently
from
March 5, 2019 15:53
14315cc to
ca963faCompare…more Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
blizzzforce-pushed
the
fix/noid/ldap-nested-group-filter
branch
from
March 5, 2019 22:14
ca963fa to
dfc7007CompareSigned-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
🤖 beep boop beep 🤖 Here are the logs for the failed build: Status of 16802: failureTESTS=acceptance, TESTS-ACCEPTANCE=app-files
Show full logTESTS=acceptance, TESTS-ACCEPTANCE=app-files-sharing
Show full logTESTS=acceptance, TESTS-ACCEPTANCE=app-files-sharing-link
Show full log |
blizzz
commented
Mar 6, 2019
MemberAuthor
failing tests are unrelated |
blizzz
commented
Mar 6, 2019
MemberAuthor
/backport to stable15 |
blizzz
commented
Mar 6, 2019
MemberAuthor
/backport to stable14 |
ChristophWurst
approved these changes
Mar 7, 2019
ChristophWurst
left a comment
Member
There was a problem hiding this comment.
🐘, but 👍 because there are tests 😉
rullzer
approved these changes
Mar 7, 2019
rullzer
left a comment
Member
There was a problem hiding this comment.
Makes sense. And tests so lets 🎢
The backport to stable15 failed. Please do this backport manually. |
The backport to stable14 failed. Please do this backport manually. |
This was referenced Mar 7, 2019
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of #8227
As described by @Cybso in #8227 (comment), when users were not part directly of a whitelisted group, but of an excluded subgroup, they would wrongly not appear as member of the top group. While the excluded groups should not be used and shown in Nextcloud, their users still qualify to be associated with the top group. Users are only subject to user filter and user base restrictions.
We have had three places covering the nesting logic aka recursive lookup. I continued @Cybso approach to cover all cases, and consolidating it into one. Plus, integration tests make sure that all desired users are being found :)