Bug 43321 - ignore case in windowscomputer_sync_s4_to_ucs_check_rename cn check
ignore case in windowscomputer_sync_s4_to_ucs_check_rename cn check
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-4-errata
Assigned To: Felix Botner
Stefan Gohmann
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-10 15:24 CET by Felix Botner
Modified: 2017-01-18 13:58 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.171
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2017011021000141
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2017-01-10 15:24:42 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
Comment 1 Felix Botner univentionstaff 2017-01-10 17:25:26 CET
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
Comment 2 Felix Botner univentionstaff 2017-01-11 09:55:52 CET
jenkins test ok.
Comment 3 Stefan Gohmann univentionstaff 2017-01-17 07:37:48 CET
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.
Comment 4 Janek Walkenhorst univentionstaff 2017-01-18 13:58:25 CET
<http://errata.software-univention.de/ucs/4.1/379.html>