Bug 34327 - FQDN search broken when combined with filter
FQDN search broken when combined with filter
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Computers
UCS 3.2
All Linux
: P5 normal (vote)
: UCS 4.1-1-errata
Assigned To: Florian Best
Johannes Keiser
:
Depends on: 22139
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-12 17:07 CET by Philipp Hahn
Modified: 2016-03-18 06:44 CET (History)
6 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): Cleanup, Troubleshooting, Usability
Max CVSS v3 score:
hahn: Patch_Available+


Attachments
Fix univention.admin.filter.replace_fqdn_filter() (3.44 KB, patch)
2014-03-12 17:07 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2014-03-12 17:07:50 CET
Created attachment 5827 [details]
Fix univention.admin.filter.replace_fqdn_filter()

+++ This bug was initially created as a clone of Bug #22139 +++

Only the first occurrence of "fqdn=" is replaced, which breaks if fqdn is used multiple times in a LDAP filter expression:

# udm computers/computer list --filter '(&(|(cn=ox61)(cn=ox60))(associatedDomain=phahn.dev))' | grep ^DN
DN: cn=ox60,cn=dc,cn=computers,dc=phahn,dc=dev
DN: cn=ox61,cn=dc,cn=computers,dc=phahn,dc=dev

# udm computers/computer list --filter '(|(fqdn=ox61.phahn.dev)(fqdn=ox60.phahn.dev))' | grep ^DN

# tail /var/log/univention/directory-manager-cmd.log
... uldap.search filter=...(|(&(cn=ox61)(associatedDomain=phahn.dev))(fqdn=ox60.phahn.dev)))...

Code in /usr/share/pyshared/univention/admin/filter.py

Also see <http://www.ietf.org/rfc/rfc2254.txt> for LDAP filter string syntax.
Comment 1 Florian Best univentionstaff 2016-03-04 15:40:05 CET
Very good patch, thanks.

univention-directory-manager-modules (11.0.2-22):
r67924 | Bug #34327: fix fqdn search filter

univention-directory-manager-modules.yaml:
r67925 | YAML Bug #34327
Comment 2 Johannes Keiser univentionstaff 2016-03-11 13:22:19 CET
CHANGES: OK
YAML: OK
Comment 3 Johannes Keiser univentionstaff 2016-03-11 13:22:35 CET
VERIFIED
Comment 4 Johannes Keiser univentionstaff 2016-03-11 16:03:08 CET
Testes with:

# udm computers/computer list --filter '(&(|(cn=61)(cn=62))(associatedDomain=mydomain.intranet))' | grep ^DN

DN: cn=61,cn=computers,dc=mydomain,dc=intranet
DN: cn=62,cn=computers,dc=mydomain,dc=intranet


# udm computers/computer list --filter '(|(fqdn=61.mydomain.intranet)(fqdn=62.mydomain.intranet))' | grep ^DN

DN: cn=61,cn=computers,dc=mydomain,dc=intranet
DN: cn=62,cn=computers,dc=mydomain,dc=intranet
Comment 5 Florian Best univentionstaff 2016-03-18 06:44:16 CET
<http://errata.software-univention.de/ucs/4.1/131.html>