Univention Bugzilla – Bug 57113
UMC-Server: LDAP connection leak
Last modified: 2024-03-20 17:18:18 CET
One leaking LDAP connection which is opened for the logged in user is created and not closed as LDAP connections are cached. But the cache indicator is broken and is bound to the request instead of the session. Therefore every new request opens a new LDAP connection. Reproducer: ```python import objgraph import univention.management.console.message x = univention.management.console.message.Request('foo') y = univention.management.console.message.Request('foo') x.user_dn = y.user_dn = 'uid=Administrator,cn=users,dc=school,dc=dev' x.password = y.password = 'univention' lo = x.get_user_ldap_connection() print(objgraph.count('univention.admin.uldap.access')) # prints 1 lo2 = x.get_user_ldap_connection() lo2 = y.get_user_ldap_connection() print(objgraph.count('univention.admin.uldap.access')) # prints 2 (or 3), should print 1 ```
UCS 5.2: univention-management-console (14.0.6) 6454211c3107 | fix(umc): fix LDAP connection and memory leak UCS 5.1: univention-management-console (13.0.11) 6b9237f7182b | fix(umc): fix LDAP connection and memory leak UCS 5.0-7: univention-management-console.yaml 4cfe84207023 | fix(umc): fix LDAP connection and memory leak univention-management-console (12.0.33-1) 4cfe84207023 | fix(umc): fix LDAP connection and memory leak
OK: changelog and YAML OK: jenkins tests OK: UMC functionality OK: reproducer now correctly prints 1 OK: using the UMC memory analyzer functionality, verify that there are no increasing objects of type univention.admin.uldap.access OK: setting umc/http/processes=0 spawns $(nproc) umc processes OK: the circular reference has been removed
<https://errata.software-univention.de/#/?erratum=5.0x996>