-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
bad search filter - during specific address book ldap searches #4934
Comments
Comment by @alecpl on 17 Nov 2015 16:08 UTC Confirmed. Thanks for the patch, but the fix belongs to the acl plugin around line 742. |
Owner changed by @alecpl on 17 Nov 2015 16:08 UTC => alec |
Milestone changed by @alecpl on 17 Nov 2015 16:08 UTC later => 1.1.4 |
Comment by c schwamborn on 17 Nov 2015 19:00 UTC Ah I see, fulltext_search_filter is supposed to compile a filter of what ever list is provided without questioning it's content. |
Status changed by @alecpl on 17 Nov 2015 19:13 UTC new => closed |
Comment by c schwamborn on 17 Nov 2015 20:49 UTC I've seen you closed the ticket and don't want to bother you, but I tested your patch from [the patch (and with my 'hotfix') the filter looked like this
The result would again be a query in all fieldmap attributes: |
Comment by @alecpl on 18 Nov 2015 06:43 UTC Yes. It is intentional. It is exactly the behaviour from before the regression. We can improve that in some way, maybe by using contactlist_fields option. I think using the whole fieldmap is not the best way. |
Reported by c schwamborn on 17 Nov 2015 15:12 UTC as Trac ticket #1490591
Hello,
playing with a 1.1.2 version of roundcube and the acl plugins I found a little bug in the ldap search filter compilation.
I've configured an internal global addressbook wich works fine as an addressbook, but when it's used to autocomplete the user search in the acl plugin nothing happend, no user was found. Same setup as an older 1.0.x version which worked.
Assume a fieldmap setup with multiple mail attibutes using the quantifier '*' as documented:
$rcmail_config[= array(
...cut...
'fieldmap' => array(
'name' => 'cn',
'surname' => 'sn',
'firstname' => 'givenName',
'email' => 'mail:*',
),
...cut...
putting some additional debug lines to:
rcube_ldap.php
class rcube_ldap
function search
around line
$filter = rcube_ldap_generic::fulltext_search_filter($value, $attributes, $mode);
logging the content of $value, $attributes, $mode, and finally $filter produced the following output:
==> console <==
15-Nov-2015 22:32:23 +0100: <2upg2e07> foo
22:32:23 +0100: <2upg2e07> array (
0 => 'cn',
1 => 'sn',
2 => 'givenName',
3 => 'mail:',
4 => 'uid',
)
22:32:23 +0100: <2upg2e07> 0
22:32:23 +0100: <2upg2e07> (|(cn=foo)(sn=foo)(givenName=foo)(mail:=foo)(uid=foo))
==> errors <==
22:32:23 +0100: <2upg2e07> PHP Error: ldap_search failed for dn=: Bad search filter (POST /roundcube/?_task=settings&_action=plugin.acl-autocomplete?_task=&_action=)
with the atteched (crude) patch in function fulltext_search_filter, a usefull search filter came up:
(|(cn=foo)(sn=foo)(givenName=foo)(mail=foo)(uid=foo))
The current code on github of this particular function is still the same as in version 1.1.2 I used.
Best regards, Christian
Migrated-From: http://trac.roundcube.net/ticket/1490591
The text was updated successfully, but these errors were encountered: