-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Respect User enumeration #18683
Respect User enumeration #18683
Conversation
Respect shareapi_allow_share_dialog_user_enumeration in user_ldap filter generation function to increase seach performance in sharing dialog.
A new inspection was created. |
Should also be respected in getAdvancedFilterPartForSearch() |
Thanks a lot for your contribution! Alternatively you can add a comment here where you state that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/ |
@blizzz I just discussed with @foobarable the performance of the fix that was introduced with #18353 The question here is if this has effects to the user management search. Any idea how to handle this? |
@owncloud-bot this is okay to test |
I discussed this with @foobarable: Yes, it has impact, when you search for a user on the User page. However, an admin usually knows the user id, so it should not be a problem. Listings without search term work normally. |
The direct approach is: diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index a2eb834..7f928e0 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -1121,8 +1121,12 @@ class Access extends LDAPUtility implements user\IUserTools {
}
$searchWords = explode(' ', trim($search));
$wordFilters = array();
+ $config = \oc::$server->getConfig();
+ $allowEnum = $config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', false);
foreach($searchWords as $word) {
- $word .= '*';
+ if($allowEnum === true) {
+ $word .= '*';
+ }
//every word needs to appear at least once
$wordMatchOneAttrFilters = array();
foreach($searchAttributes as $attr) { It adds a bit of duplication (getting the config instance, fetching the value, modifying the search termn), this could be summed up in a method of it's own e.g. (prepareSearchTerm($term)) that returns the final search term as done by
The advanced method just calls it for every $word. |
@foobarable Can we get the second change that was proposed by @blizzz in? |
we are beyond feature freeze -> 9.0 |
@blizzz anything missing? THX |
@foobarable Still open ;) Did you recently found time to fix the remaining stuff? |
@owncloud/ldap can you test this? You can also use this shorthand mention to get your pull requests reviewed. :) |
@blizzz @MorrisJobke
|
Looks good. Can you please apply the changes? (you don't need to merge in the master branch via github ;)) |
I second @MorrisJobke |
The patch as i wrote it does not work yet in Version 8.2.1.4 Still trying to find out what's wrong. |
Created new pull request here: #21324 |
Respect shareapi_allow_share_dialog_user_enumeration in user_ldap filter
generation function to increase seach performance in sharing dialog.
cc @blizzz @MorrisJobke