Univention Bugzilla – Bug 35136
Using brackets in the version of an INI file make the registration fail
Last modified: 2014-09-11 14:46:54 CEST
I used the following version string in the INI file of the UCC app: [Application] ID=ucc Name=Univention Corporate Client 2.0 Version=2.0 (rev2) This leads to an error when registering the app after the successful update/installation. The following traceback was logged: 20.05.14 08:51:42.298 MODULE ( PROCESS ) : Aufruf des Nach-Installations-Triggers python-support 20.05.14 08:51:43.953 MODULE ( ERROR ) : Registering LDAP object failed. Bad search filter 20.05.14 08:51:43.953 MODULE ( PROCESS ) : Die Registrierung der Applikation im LDAP ist fehlgeschlagen. Sie wird bei jedem Öffnen des App Center Moduls wiederholt werden. 20.05.14 08:51:43.953 MODULE ( WARN ) : Die Registrierung der Applikation im LDAP ist fehlgeschlagen. Sie wird bei jedem Öffnen des App Center Moduls wiederholt werden. 20.05.14 08:51:43.967 MODULE ( WARN ) : Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/appcenter/app_center.py", line 1399, in install self.tell_ldap(component_manager.ucr, package_manager) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/appcenter/app_center.py", line 1205, in tell_ldap ldap_object = iapp.get_ldap_object(or_create=True) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/appcenter/app_center.py", line 1104, in get_ldap_object return ApplicationLDAPObject(ldap_id, lo, co) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/appcenter/app_center.py", line 126, in __init__ self.reload() File "/usr/lib/pymodules/python2.6/univention/management/console/modules/appcenter/app_center.py", line 129, in reload result = appcenter_udm_module.lookup(self._co, self._lo, 'id=%s' % self._ldap_id) File "/usr/lib/pymodules/python2.6/univention/admin/handlers/appcenter/app.py", line 401, in lookup for dn, attrs in lo.search(unicode(filter), base, scope, [], unique, required, timeout, sizelimit): File "/usr/lib/pymodules/python2.6/univention/admin/uldap.py", line 355, in search raise univention.admin.uexceptions.ldapError, _err2str(msg) ldapError: Bad search filter As a workaround I avoided the brackets in the version string, but we should fix the underlying bug.
- appcenter_udm_module.lookup(self._co, self._lo, 'id=%s' % self._ldap_id) + appcenter_udm_module.lookup(self._co, self._lo, 'id=%s' % ldap.filter.escape_filter_chars(self._ldap_id)) _ldap_id can be two values: udm_object.info['id'] # if already exists '%s_%s' % (app.id, app.get('version')) # if it is new Needs to be tested for both cases, but should work. We should also fix appcenter_udm_module.lookup(co, lo, '(&(id=%s_*)(server=%s))' % (self.id, localhost)) (altough the ID of an application is normally "safe") There is also container_udm_module.lookup(co, lo, 'cn=%s' % container, base=base) which can also have the application's id as "container".
Fixed in univention-management-console-module-appcenter 3.0.51-23.257.201407081251 Setting UCR variable in postinst
(In reply to Dirk Wiesenthal from comment #2) > Setting UCR variable in postinst I meant: ID and Version may contain brackets
My tests where fine (i.e., installation, upgrade, removal with uncommon characters in the version string) and produced DNs similar to this one: DN: univentionAppID=univention-demo_0.3 (\3D\3D**!!gamma!!**\3D\3D),cn=univention-demo,cn=apps,cn=univention,dc=ucs322,dc=qa YAML file → OK
http://errata.univention.de/ucs/3.2/139.html