Bug 28662 - Allocators: value not ldap escaped
Allocators: value not ldap escaped
Status: CLOSED WONTFIX
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 2.4
Other Linux
: P5 normal (vote)
: UCS 3.x
Assigned To: UMC maintainers
:
: 35503 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-27 14:57 CEST by Sönke Schwardt-Krummrich
Modified: 2018-04-13 13:28 CEST (History)
4 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2012-09-27 14:57:55 CEST
Wird versucht über einen UDM-Allocator ein Attribut mit einem Value zu reservieren, der Klammern enthält, wird ein Traceback geworfen, weil der Suchfilter anschließend nicht gültig ist.

[...]
  File "/usr/lib/python2.4/site-packages/univention/admin/handlers/my/module.py", line 168, in _ldap_addlist
    univention.admin.allocators.request(self.lo, self.position, ldapattr, value = self[propertyname])
  File "/usr/lib/python2.4/site-packages/univention/admin/allocators.py", line 167, in request
    return acquireUnique(lo, position, type, value, _type2attr[type], scope = _type2scope[type])
  File "/usr/lib/python2.4/site-packages/univention/admin/allocators.py", line 157, in acquireUnique
    if not lo.searchDn(base=searchBase, filter='%s=%s' % (attr, value)):
  File "/usr/lib/python2.4/site-packages/univention/admin/uldap.py", line 331, in searchDn
    raise univention.admin.uexceptions.ldapError, _err2str(msg)
univention.admin.uexceptions.ldapError: Bad search filter

In UCS 2.4 aufgefallen, betrifft aber alle Versionen. Es gibt noch mehr Stellen im allocator, die ebenfalls betroffen sind. Bitte mitfixen.

Der Value sollte mit ldap.filter.escape_filter_chars() vorher umkodiert werden.
Comment 1 Dirk Wiesenthal univentionstaff 2012-09-27 15:51:38 CEST
Die UDM-Suche wurde zufällig gestern gefixt: Bug #16387. Wenn man den String für den Allocator umkodiert, muss man aufpassen, nicht zu tief einzusteigen, um nicht Strings zweimal zu escapen - oder man nimmt meinen LDAPSearchSanitizer in der UMC-UDM-Funktion query wieder raus.

Außerdem wurde gestern zufällig auch Bug #24341 gefixt. Dort kann man nach mehreren Attributen gleichzeitig suchen. Dafür brauche ich (|()()()) im Suchstring...
Comment 2 Stefan Gohmann univentionstaff 2012-09-28 07:21:13 CEST
Nicht zu viel Zeit in das Thema investieren, da der Code durch Bug #26383 vermutlich komplett entfernt werden kann.
Comment 3 Florian Best univentionstaff 2015-04-20 10:28:08 CEST
*** Bug 35503 has been marked as a duplicate of this bug. ***
Comment 4 Stefan Gohmann univentionstaff 2016-04-25 07:52:11 CEST
This issue has been filed against UCS 2.4.

UCS 2.4 is out of maintenance and many UCS components have vastly changed in
later releases. Thus, this issue is now being closed.

If this issue still occurs in newer UCS versions, please use "Clone this bug".
In this case please provide detailed information on how this issue is affecting
you.
Comment 5 Florian Best univentionstaff 2016-04-25 11:17:45 CEST
Bug #41111