Bug 24828

Summary: Anlegen eines Networks:Network Objekts mit IPv4-Adresse und Netzmaske die größer als 32 ist erzeugt Traceback
Product: UCS Reporter: Lukas Walter <walter>
Component: UDM (Generic)Assignee: Florian Best <best>
Status: CLOSED FIXED QA Contact: Johannes Keiser <keiser>
Severity: normal    
Priority: P5 CC: best
Version: UCS 4.1Flags: best: Patch_Available+
Target Milestone: UCS 4.2-1-errata   
Hardware: Other   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=34035
https://forge.univention.org/bugzilla/show_bug.cgi?id=24674
https://forge.univention.org/bugzilla/show_bug.cgi?id=44239
https://forge.univention.org/bugzilla/show_bug.cgi?id=44389
What kind of report is it?: Development Internal 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): IPv6
Max CVSS v3 score:
Attachments: patch

Description Lukas Walter univentionstaff 2011-11-23 11:12:54 CET
=============================================================================
File '/usr/lib/pymodules/python2.6/notifier/threads.py', line 81, in _run
tmp = self._function()
File '/usr/lib/pymodules/python2.6/notifier/__init__.py', line 104, in __call__
return self._function( *tmp, **self._kwargs )
File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py', line 265, in _thread
dn = module.create( properties, container = options.get( 'container' ), superordinate = options.get( 'superordinate' ) )
File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line 130, in wrapper_func
ret = func( *args, **kwargs )
File '/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py', line 302, in create
obj.create()
File '/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py', line 332, in create
return self._create()
File '/usr/lib/pymodules/python2.6/univention/admin/handlers/__init__.py', line 627, in _create
al=self._ldap_addlist()
File '/usr/lib/pymodules/python2.6/univention/admin/handlers/networks/network.py', line 232, in _ldap_addlist
self.stepIp()
File '/usr/lib/pymodules/python2.6/univention/admin/handlers/networks/network.py', line 185, in stepIp
network = ipaddr.IPNetwork(self['network'] + '/' + self['netmask'])
File '/usr/lib/python2.6/dist-packages/ipaddr.py', line 119, in IPNetwork
address)

ValueError: '10.0.0.0/64' does not appear to be an IPv4 or IPv6 network
=============================================================================
Comment 1 Florian Best univentionstaff 2016-10-31 12:19:09 CET
Still with UCS 4.1:

# udm networks/network create --set name=foo --set network=1.2.3.4 --set netmask=64
Traceback (most recent call last):
  File "/usr/share/univention-directory-manager-tools/univention-cli-server", line 222, in doit
    output = univention.admincli.admin.doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 394, in doit
    out=_doit(arglist)
  File "/usr/lib/pymodules/python2.7/univention/admincli/admin.py", line 736, in _doit
    dn=object.create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 305, in create
    return self._create()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/__init__.py", line 721, in _create
    al = self._ldap_addlist()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/networks/network.py", line 246, in _ldap_addlist
    self.stepIp()
  File "/usr/lib/pymodules/python2.7/univention/admin/handlers/networks/network.py", line 183, in stepIp
    network = ipaddr.IPNetwork(self['network'] + '/' + self['netmask'])
  File "/usr/lib/python2.7/dist-packages/ipaddr.py", line 119, in IPNetwork
    address)
ValueError: '1.2.3.4/64' does not appear to be an IPv4 or IPv6 network
Comment 2 Florian Best univentionstaff 2016-10-31 12:19:19 CET
Created attachment 8172 [details]
patch
Comment 3 Florian Best univentionstaff 2017-07-28 15:51:29 CEST
Patch applied.

univention-directory-manager-modules (12.0.18-6):
r81534 | Bug #24828: fix error when invalid netmask is given in network objects

univention-directory-manager-modules.yaml:
r81534 | Bug #24828: fix error when invalid netmask is given in network objects
Comment 4 Johannes Keiser univentionstaff 2017-07-31 11:50:50 CEST
OK No more traceback. The error message is shown as popup dialog.
YAML: OK
-> verified
Comment 5 Arvid Requate univentionstaff 2017-08-02 14:34:08 CEST
<http://errata.software-univention.de/ucs/4.2/121.html>