Bug 24888 - Installer hängt bei sehr langem Domainname/FQDN
Installer hängt bei sehr langem Domainname/FQDN
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UCS Installer
UCS 3.0
Other Linux
: P5 normal (vote)
: UCS 3.2
Assigned To: Felix Botner
Moritz Muehlenhoff
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-25 10:17 CET by Florian Best
Modified: 2013-12-09 17:24 CET (History)
6 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 2011-11-25 10:17:18 CET
Der Installer hängt sich auf, wenn der letzte Teil des FQDN zu lang ist: 
mit 26 zeichen funktioniert es noch, mit 30 zeichen hängt er. 
Der Hostname war 15zeichen, der erste Teil der Domain 14zeichen.
FQDN: 15Zeichen.14Zeichen.30Zeichen
Auf eine andere TTY kann ich Problemlos wechseln und den Installer neustarten.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2011-11-25 10:32:22 CET
Nach der Eingabe des sehr langen FQDNs wurde F12 gedrückt. Anschließend hat der Installer nicht mehr auf F11/F12 reagiert und hing.
Comment 2 Moritz Muehlenhoff univentionstaff 2013-05-31 10:43:32 CEST
We will not ship a UCS 3.1-2 release; the next UCS release will be UCS 3.2.

As such, this bug is moved to the new target milestone.
Comment 3 Felix Botner univentionstaff 2013-07-03 13:26:59 CEST
Das lag am regex in syntax_is_domainname(). Den habe ich jetzt etwas vereinfacht, dafür noch zwei weitere Tests (".-" or "-." in domainname) eingebaut. Damit sollte es funktionieren.
Comment 4 Florian Best univentionstaff 2013-07-04 14:42:37 CEST
The same have to be done for syntax_is_windowsdomain.

if "-." in domainname or ".-" in domainname:
    return False
_re = re.compile(r"^([a-z][a-z0-9]+[a-z0-9-]\.)*[a-z][a-z0-9]*$")

Also the compiling should be done outside of the function otherwise it has no advantage compared to re.match(..., ...).
Comment 5 Felix Botner univentionstaff 2013-07-04 16:52:49 CEST
(In reply to Florian Best from comment #4)
> The same have to be done for syntax_is_windowsdomain.
> 
> if "-." in domainname or ".-" in domainname:
>     return False
> _re = re.compile(r"^([a-z][a-z0-9]+[a-z0-9-]\.)*[a-z][a-z0-9]*$")
> 
> Also the compiling should be done outside of the function otherwise it has
> no advantage compared to re.match(..., ...).

ok, fixed syntax_is_windowsdomain, removed the "." test from the regex, which leeds to: ^[a-z][a-z0-9-]*[a-z0-9]$ 
because dots aren't allowed anyway (see installer/modules/50_basis.py)
Comment 6 Florian Best univentionstaff 2013-07-08 13:41:06 CEST
The fix allows "foo..bar".

Philipp suggested:

def is_domainname(domainname):
  """
  Check if domainname is a valid DNS domainname accoring to RFC952/1123.
  >>> is_domainname('foo')
  True
  >>> is_domainname('f00.bar')
  True
  >>> is_domainname('-f.bar')
  False
  >>> is_domainname('f-.bar')
  False
  >>> is_domainname('f..bar')
  False
  >>> is_domainname('#.bar')
  False
  >>> is_domainname('1234567890123456789012345678901234567890123456789012345678901234.bar')
  False
  """
  return all(is_domainname.RE.match(_) for _ in domainname.split('.'))
is_domainname.RE = re.compile(r'^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$', re.I)
Comment 7 Felix Botner univentionstaff 2013-07-15 17:10:14 CEST
fixed
Comment 8 Florian Best univentionstaff 2013-08-07 15:14:02 CEST
Windowsdomain with one char is now disallowed → REOPENED.
Comment 9 Felix Botner univentionstaff 2013-08-08 14:47:50 CEST
fixed, 

+ if domainname.endswith("-") or domainname.startswith("-") or "--" in domainname:
+   return False
+ _re=re.compile("^[a-z0-9-]+$")
Comment 10 Moritz Muehlenhoff univentionstaff 2013-08-09 13:56:28 CEST
I could successfully install system with a 15.14.30 FQDN. Basic UMC tests of the installed systems were succesful. Changelog entry exists.
Comment 11 Stefan Gohmann univentionstaff 2013-11-19 06:41:29 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

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