Univention Bugzilla – Bug 35580
Import of license with long base DN fails
Last modified: 2014-09-10 17:34:07 CEST
Bug #30156 introduced a new check whether the license if valid: Something like for line in license: if line.startswith('dn: '): if not line.endswith(ldapBase): Problem: Long base DNs are written in two lines. So the license is rejected although the import would (presumably) work. One should use some LDIF library instead of reading the file. Workaround: Manually merge the lines before importing.
This is a regression. We should really fix it.
In ucs-3.2-2/management/univention-management-console-module-udm/umc/python/udm/__init__.py:280 the with-block checks if the local base DN matches exactly with the DN within the license file (and not only with a substring). The second with-block uses LicenseImport().check(ldapBase) from umc/python/udm/tools.py, which seems to do the same. What is the reason for checking the DN twice?
(In reply to Sönke Schwardt-Krummrich from comment #2) > In > ucs-3.2-2/management/univention-management-console-module-udm/umc/python/udm/ > __init__.py:280 the with-block checks if the local base DN matches exactly > with the DN within the license file (and not only with a substring). > > The second with-block uses LicenseImport().check(ldapBase) from > umc/python/udm/tools.py, which seems to do the same. What is the reason for > checking the DN twice? Correct observation. I moved the functionality of the first with-block into the class LicenseImport. There the handling of multi-line values is already handled correctly. I check various error cases for the LDIF license file, they worked fine. univention-management-console-module-udm (4.0.99-4): * Bug #35580: fix handling of license LDIF files to allow for long DNs The YAML file 2014-08-26-univention-management-console-module-udm.yaml has been extended.
You do not need to pass "base" to the function. There is self.base
(In reply to Dirk Wiesenthal from comment #4) > You do not need to pass "base" to the function. There is self.base It was already there and I won't touch it ;) .
(In reply to Dirk Wiesenthal from comment #4) > You do not need to pass "base" to the function. There is self.base If I see it correctly, "base" is the value from UCR ldap/base, and self.base is the base that is registered in the license, i.e., FFPU for a FFPU license.
Changes have been merged to 4.0 branch.
Fix: OK, various error formats are still recognized, LDIF-line breakings are working, ~ error message is a little bit wrong if cn=univention is missing in the DN but that will probably not occur. Code-Review: OK UCS4 merge: OK YAML: OK
http://errata.univention.de/ucs/3.2/187.html