Univention Bugzilla – Bug 56044
UDM traceback with some patterns
Last modified: 2023-05-09 13:02:02 CEST
When searching for a single 'ü' (a german umlaut) the UDM frontend shows a traceback: ``` Internal server error during "udm/query (users/user)". Request: udm/query (users/user) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/notifier/threads.py", line 80, in _run result = self._function() File "/usr/lib/python3/dist-packages/notifier/__init__.py", line 105, in __call__ return self._function(*tmp, **self._kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/udm/__init__.py", line 615, in _thread result = module.search(container, objectProperty, objectPropertyValue, superordinate, scope=scope, hidden=hidden, allow_asterisks=USE_ASTERISKS) File "/usr/lib/python3/dist-packages/univention/management/console/modules/udm/udm_ldap.py", line 678, in search result = self.module.lookup(None, ldap_connection, filter_s, base=container, superordinate=superordinate, scope=scope, sizelimit=sizelimit, **kwargs) File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1795, in lookup for dn, attrs in lo.search(filter_str, base, scope, attr, unique, required, timeout, sizelimit, serverctrls=serverctrls, response=response): File "/usr/lib/python3/dist-packages/univention/admin/uldap.py", line 673, in search raise univention.admin.uexceptions.ldapError('%s: %s' % (_err2str(msg), filter)) univention.admin.uexceptions.ldapError: LDAP Error: Bad search filter: No such file or directory: (&(univentionObjectType=users/user)(!(uidNumber=0))(!(univentionObjectFlag=functional))(&(!(univentionObjectFlag=hidden))(|(|(uid=*ü*)(uid=ü))(|(givenName=*ü*)(givenName=ü))(|(sn=*ü*)(sn=ü))(|(description=*ü*)(description=ü))(|(mailPrimaryAddress=**)(mailPrimaryAddress=))))).``` The problematic 'bad search filter' is the expression `(|(mailPrimaryAddress=**)(mailPrimaryAddress=))`. Seems the class univention.admin.filter.expression builds this invalid search filter when the syntax of the corresponding attribute cleans up invalid chars (like umlauts in a mail address). I did not dive into the mode how UDM calls the functions of this class (which flags for asterisk handling are used). The error is reproducible also from @school, where the models construct their search filters (function build_easy_filter).
Sorry I omitted an important detail: the traceback is triggered whenever the mail address is in the attributes to be queried: (1) when 'default properties' is selected, and also (2) when I explicitly select 'search in E-Mail address'
Also occurs for the following letters: ä,Ä,ö,Ö,ü,Ü,é (I guess every special character) as long as they are single.