Bug 19557 - Nameserver der Reverse-Zone mit Punkt am Ende
Nameserver der Reverse-Zone mit Punkt am Ende
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: DNS
UCS 2.4
Other Linux
: P5 normal (vote)
: UCS 3.0-1
Assigned To: Janek Walkenhorst
Philipp Hahn
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-20 16:03 CEST by Philipp Hahn
Modified: 2012-03-04 14:34 CET (History)
3 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:
klaeser: Patch_Available+


Attachments
patch für 2.4.4 (1.80 KB, patch)
2011-10-13 10:21 CEST, Florian Best
Details | Diff
patch für 3.0 (1.63 KB, patch)
2011-10-13 10:22 CEST, Florian Best
Details | Diff
neuer patch für 2.4.4 (1.81 KB, text/plain)
2011-10-13 10:50 CEST, Florian Best
Details
patch für 3.0 (1.63 KB, text/plain)
2011-10-13 10:51 CEST, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2010-08-20 16:03:47 CEST
$ udm dns/forward_zone create --set zone=pmh50.qa. --set nameserver=$(hostname -f)
Object created: zoneName=pmh50.qa.,dc=pmhahn50,dc=qa
                                 ^
Gerade im Zusammenhang mit DNS, wo oft Punkte am Ende angegeben werden müssen, ist das sehr fehleranfällig.

/usr/share/pyshared/univention/admin/handlers/dns/forward_zone.py:
property_descriptions={
        'zone': univention.admin.property(
                        syntax=univention.admin.syntax.string,

Stichwort: IDN, Punycode, rfc1034

len(text) <= 255
max(map(len, text.split('.'))) <= 63
None not in map(re.compile('^[a-zA-Z](:?[a-zA-Z0-9-]{0,63}[a-zA-Z0-9])?$'), text.split('.'))
Comment 1 Florian Best univentionstaff 2011-10-13 10:21:46 CEST
Created attachment 3626 [details]
patch für 2.4.4
Comment 2 Florian Best univentionstaff 2011-10-13 10:22:07 CEST
Created attachment 3627 [details]
patch für 3.0
Comment 3 Florian Best univentionstaff 2011-10-13 10:39:57 CEST
Neu ist die Klasse dnsZone die per regex 255-Zeichen lange dns-Zonen-Strings matcht (zwischen Punkten maximal 63 alphanumerische Zeichen (und Bindestriche), erstes Zeichen: a-zA-Z, letztes Zeichen kann kein Punkt sein). Falls das nicht zutrifft wirft es verschiedene Exceptions.
Comment 4 Florian Best univentionstaff 2011-10-13 10:50:36 CEST
Created attachment 3628 [details]
neuer patch für 2.4.4

DNS Zonen können jetzt auch Ziffern an erster Stelle enthalten (http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names)
Comment 5 Florian Best univentionstaff 2011-10-13 10:51:01 CEST
Created attachment 3629 [details]
patch für 3.0
Comment 6 Stefan Gohmann univentionstaff 2011-10-14 23:03:53 CEST
Patch sieht OK aus, aber besser nach 3.0.
Comment 7 Philipp Hahn univentionstaff 2011-11-22 20:44:48 CET
Bitte auch Attachment 3861 [details] aus Bug #23945 beachten
Comment 8 Stefan Gohmann univentionstaff 2011-12-04 11:10:08 CET
Für Forward Zonen wird mittlerweile der Punkt für den Nameserver automatisch ergänzt. Das sollte für den Nameserver der Reverse Zone auch gemacht werden.
Comment 9 Janek Walkenhorst univentionstaff 2012-02-13 18:18:25 CET
univention-directory-manager-modules (7.0.218-1) unstable; urgency=low

  * change dns/forward_zone->zone syntax, disallowing "." at the end (Bug #19557)
  * automatically append "." to dns/reverse_zone->nameserver if missing
  * cleanup dns/forward_zone.py
    * use SOA email functions from __init__.py
  * cleanup dns/reverse_zone.py
    * use SOA email functions from __init__.py
    * improve subnet mapping

Syntax ist jetzt:
 Label mit ohne Bindestrich am Anfang/Ende, max 63 Zeichen.
 Label mit "." zusammengesetzt, kein "." am Anfang/Ende
^([0-9A-Za-z]([0-9A-Za-z-]{0,61}[0-9A-Za-z])?)(\.([0-9A-Za-z]([0-9A-Za-z-]{0,61}[0-9A-Za-z])?))*$

Paket gebaut.

Changelog angepasst.
Comment 10 Philipp Hahn univentionstaff 2012-02-21 11:42:46 CET
OK: udm dns/forward_zone create --set zone=pmh50.qa. --set nameserver="$(hostname -f)"
OK: zone=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-X
OK: zone=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-
OK: zone=das-örtliche.de
OK: zone=-foo.bar
OK: zone=.foo.bar
→ E: Invalid Syntax: Zone name: Invalid DNS zone name! (Must not end with a ".", only "0"-"9", "A"-"Z", "a"-"z", and "-" allowed)

OK: zone=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789.test
→ E: Invalid Syntax: Zone name: A DNS zone may not be longer than 255 characters!

OK: zone=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789
OK: zone=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789
OK: zone=0foo.bar
→ Object created:

OK: udm dns/reverse_zone create subnet=1.2.3
OK: subnet=0123:4567:89ab:cd
OK: subnet=0123:4567:89ab:cdef
OK: subnet=0123:4567:89ab:cdef:0123:4567:89ab:cde
→ Object created:

OK: subnet=0123:4567:89ab:cdef:0123:4567:89ab:cdef
→ E: Invalid Syntax: Subnet: A subnet for reverse lookup consists of the first one to three parts of an IPv4 address (example: "192.168.0") or of the first 1 to 31 nibbles of an IPv6 address with leading zeroes and without :: substitution (example: "2001:0db8:010")

OK: contact=Philipp.Hahn@univention.de
OK: contact=Philipp.Hahn@univention.de.
→ Object created:

OK: nameserver=$(hostname -f)
OK: nameserver=$(hostname -f).
OK: nameserver=192.168.0.104
OK: nameserver=192.168.0.104.
→ Object created:

OK: ChangeLog svn12239
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2012-03-04 14:34:03 CET
UCS 3.0-1 wurde veröffentlicht. Sollte der hier beschriebene Bug mit einer
neueren Version von UCS erneut auftreten, so sollte dieser Bug dupliziert
werden: "Clone This Bug"