Bug 43337 - IndexError in check_common_name_length
IndexError in check_common_name_length
Status: CLOSED FIXED
Product: UCS Test
Classification: Unclassified
Component: UDM
unspecified
Other Linux
: P5 normal (vote)
: UCS 4.2
Assigned To: Florian Best
Philipp Hahn
: interim-2
Depends on: 16923
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-13 23:26 CET by Florian Best
Modified: 2017-04-04 18:28 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
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 Florian Best univentionstaff 2017-01-13 23:26:18 CET
http://jenkins.knut.univention.de:8080/job/UCS-4.2/job/UCS-4.2-0/job/AutotestJoin/10/SambaVersion=s4,Systemrolle=master/testReport/60_umc-system/80_umc-service-license/test/

Die Ausf\u00fchrung des Kommandos udm/add computers/computer ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 82, in _run
    tmp = self._function()
  File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__
    return self._function( *tmp, **self._kwargs )
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/__init__.py", line 367, in _thread
    dn = module.create(properties, container=options.get('container'), superordinate=options.get('superordinate'))
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 86, in _decorated
    return method(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/ldap.py", line 143, in _decorated
    result = func(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 386, in create
    obj.create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 306, in create
    return self._create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 705, in _create
    self._ldap_pre_create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/computers/windows.py", line 410, in _ldap_pre_create
    super(object, self)._ldap_pre_create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 2239, in _ldap_pre_create
    self.check_common_name_length()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 1684, in check_common_name_length
    zoneName = univention.admin.uldap.explodeDn(zone[0], 1)[0]
IndexError: list index out of range


[2017-01-13 10:12:13.296031] *** UMC request: "command/udm/add" (computers/computer) 
[2017-01-13 10:12:13.296051] data = [{'object': {'$options$': {'kerberos': True,
[2017-01-13 10:12:13.296062]                            'nagios': False,
[2017-01-13 10:12:13.296072]                            'posix': True,
[2017-01-13 10:12:13.296083]                            'samba': True},
[2017-01-13 10:12:13.296092]              '$policies$': {},
[2017-01-13 10:12:13.296101]              'dnsEntryZoneForward': [['']],
[2017-01-13 10:12:13.296109]              'dnsEntryZoneReverse': [['']],
[2017-01-13 10:12:13.296117]              'ip': ['10.210.0.51'],
[2017-01-13 10:12:13.296126]              'name': 'umc_test_computer_nukxej_0',
[2017-01-13 10:12:13.296135]              'network': 'cn=default,cn=networks,dc=AutoTest091,dc=local',
[2017-01-13 10:12:13.296144]              'ntCompatibility': False,
[2017-01-13 10:12:13.296154]              'primaryGroup': 'cn=Windows Hosts,cn=groups,dc=AutoTest091,dc=local',
[2017-01-13 10:12:13.296162]              'shell': '/bin/false',
[2017-01-13 10:12:13.296170]              'unixhome': '/dev/null'},
[2017-01-13 10:12:13.296180]   'options': {'container': 'cn=computers,dc=AutoTest091,dc=local',
[2017-01-13 10:12:13.296223]               'objectType': 'computers/windows'}}]
Comment 1 Florian Best univentionstaff 2017-01-14 00:04:37 CET
self['dnsEntryZoneForward'] is [[u'']] instead of [u''].
Comment 2 Florian Best univentionstaff 2017-01-14 00:18:41 CET
r75789 | Bug #43337: fix wrong usage of UDM
The test case set [['']].
Question is why did it work in UCS 4.1-4? I fixed this wrong usage in the test case.
Comment 3 Philipp Hahn univentionstaff 2017-02-08 16:57:44 CET
(In reply to Florian Best from comment #2)
> r75789 | Bug #43337: fix wrong usage of UDM
> The test case set [['']].
> Question is why did it work in UCS 4.1-4? I fixed this wrong usage in the
> test case.

OK: Further modified by ucs-4.2-0@76119 to be []

OK: Reproducer
umc-command -U Administrator -P univention udm/add -f computers/computer -r -e -o '[{"object":{"ip":"1.2.3.4","name":"test43337","dnsEntryZoneForward":[[""]],"dnsEntryZoneReverse":[[""]]},"options":{"container":"cn=computers,dc=phahn,dc=qa","objectType":"computers/windows"}}]'
udm computers/windows remove --dn cn=test43337,cn=computers,dc=phahn,dc=qa

The difference is caused by ucs-4.2-0@74205 for Bug #16923:

# python -c 'import univention.admin.objects;from univention.admin.syntax import *;print dnsEntry.parse([""]),dnsEntryReverse.parse([""])'
 with ucs-4.0 and ucs-4.1:
  [] []
 with ucs-4.2:
  [''] ['']

OK: /usr/share/ucs-test/60_umc/70_udm_network_functionality -vvvf
Comment 4 Stefan Gohmann univentionstaff 2017-04-04 18:28:47 CEST
UCS 4.2 has been released:
 https://docs.software-univention.de/release-notes-4.2-0-en.html
 https://docs.software-univention.de/release-notes-4.2-0-de.html

If this error occurs again, please use "Clone This Bug".