-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix LDAP race conditions #24052
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
Fix LDAP race conditions #24052
Conversation
apps/user_ldap/group_ldap.php
Outdated
| return $this->access->connection->getFromCache($cacheKey); | ||
| $inGroup = $this->access->connection->getFromCache($cacheKey); | ||
| if(!is_null($inGroup)) { | ||
| return $inGroup; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do make static code scanners happy like Scrutinizer can you cast this to bool?
* getFromCache is wrapped in isCached * inbetween the two calls the cache entry hits it's TTL * getFromCache returns null * this fix only checkes if the returned value is null and return only non-null values
5ebfdae to
62a5985
Compare
|
@LukasReschke I addressed your comments :) |
|
@LukasReschke @nickvergessen @blizzz Could we get this tested and merged? I really would like to have this in place. @davitol @owncloud/qa @owncloud/ldap We need some LDAP testing here. |
|
@karlitschek I would like to request a backport of this down to stable8.2 for this race condition. |
|
This fixes race conditions, that are really hard to reproduce. The testing here just involves a verification, that the LDAP connection still works. |
|
nice. please backport 👍 |
|
👍 WFM. Configuring a LDAP and a AD no problems were found |
|
I also got positive feedback. |
|
Integration tests still succeed 👍 |
|
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. |
return only non-null values
cc @blizzz @nickvergessen @LukasReschke