Univention Bugzilla – Bug 43321
ignore case in windowscomputer_sync_s4_to_ucs_check_rename cn check
Last modified: 2017-01-18 13:58:25 CET
following situation in a customer environment: -> univention-s4search cn=win1 cn sAMAccountName dn: CN=WIN1,DC=four,DC=test cn: WIN1 sAMAccountName: win1$ -> univention-ldapsearch cn=win1 cn uid dn: cn=WIN1,dc=four,dc=test cn: WIN1 uid: win1$ con_check_rename: ucs_object: {'dn': u'cn=win1,dc=four,dc=test', 'attributes': {'primaryGroupID': [u'515'], 'isCriticalSystemObject': [u'FALSE'], 'logonCount': [u'0'], 'cn': [u'WIN1'], 'countryCode': [u'0'], 'objectClass': [u'top', u'person', u'organizationalPerson', u'user', u'computer'], 'userPrincipalName': [u'host/WIN1.four.test@FOUR.TEST'], 'uid': [u'win1$'], 'instanceType': [u'4'], 'description': [u'a'], 'distinguishedName': [u'CN=WIN1,DC=four,DC=test'], 'sAMAccountType': [u'805306369'], 'objectSid': [u'S-1-5-21-854837004-1585209202-1099490383-1111'], 'whenCreated': [u'20170110124942.0Z'], 'uSNCreated': [u'3810'], 'lockoutTime': [u'0'], 'badPasswordTime': [u'0'], 'pwdLastSet': [u'131285261820000000'], 'sAMAccountName': [u'win1$'], 'objectCategory': [u'CN=Computer,CN=Schema,CN=Configuration,DC=four,DC=test'], 'objectGUID': [u'\xaa\xab\xf84\xaf\xbc.O\xaa\xcd\x82\x1d\xe6o\x1b\x8e'], 'whenChanged': [u'20170110141531.0Z'], 'badPwdCount': [u'0'], 'accountExpires': [u'9223372036854775807'], 'name': [u'WIN1'], 'codePage': [u'0'], 'userAccountControl': [u'4096'], 'lastLogon': [u'0'], 'sambaSID': u'1111', 'uSNChanged': [u'3853'], 'lastLogoff': [u'0']}, 'changed_attributes': ['description', 'whenChanged', 'uSNChanged'], 'modtype': 'modify'} con_check_rename: Renaming client from WIN1 to win1 Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 1505, in sync_to_ucs f(self, property_type, object) File "/usr/lib/pymodules/python2.7/univention/s4connector/s4/computer.py", line 123, in windowscomputer_sync_s4_to_ucs_check_rename ucs_admin_object.modify() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 317, in modify return self._modify(modify_childs, ignore_license=ignore_license) File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 805, in _modify ml = self._ldap_modlist() File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/windows.py", line 546, in _ldap_modlist raise univention.admin.uexceptions.uidAlreadyUsed(': %s' % requested_uid) uidAlreadyUsed: : win1$ Actually, (1) there is nothing to do here, uid/sAMAccountName and cn/cn are in sync => maybe windowscomputer_sync_s4_to_ucs_check_rename should check uid and sAMAccountName instead of s4 cn and ucs uid (minus the $)? (2) and we can't rename a windows object to a "only case is different" new name => check case insensitive
added (case insensitive) uid sAMAccountName check in windowscomputer_sync_s4_to_ucs_check_rename cn check univention-s4-connector: r75664 YAML: univention-s4-connector.yaml merged to 4.2-0 added 403rename_computer_object_uid_sAMAccountName to s4connector tests. ucs-test: r75662 merged to 4.2-0 lets wait for the jenkins tests
jenkins test ok.
Tests: OK, I was able to reproduce it with the previous connector version. ucs-test: OK Code review: OK UCS 4.2 merge: OK YAML: OK The test case helps to make the QA, thanks. For the future, it would be better if you use random names otherwise the test might fail if you start it again.
<http://errata.software-univention.de/ucs/4.1/379.html>