Bug 37816 - system setup allows only lowercase hostnames
system setup allows only lowercase hostnames
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Setup wizard
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-2-errata
Assigned To: Alexander Kramer
Sönke Schwardt-Krummrich
:
Depends on:
Blocks: 38734
  Show dependency treegraph
 
Reported: 2015-02-16 17:37 CET by Florian Best
Modified: 2015-08-11 09:23 CEST (History)
5 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:
best: Patch_Available+


Attachments
patch (2.95 KB, patch)
2015-02-16 17:37 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2015-02-16 17:37:34 CET
Created attachment 6680 [details]
patch

The regex in system-setup misses the re.IGNORECASE flag. Everywhere else we allow RFC 952 like hostnames (UDM, join module, UCS@school).

When trying to install UCS you get a validation error containing a typo: "Der Rechernamen muss vollständig und kleingeschrieben sein".

since UCS 3.0: is_hostname()
https://billy.knut.univention.de/websvn/filedetails.php?repname=dev&path=%2Fbranches%2Fucs-3.0%2Fucs%2Fbase%2Funivention-system-setup%2Fumc%2Fpython%2Fsetup%2Futil.py
Comment 1 Florian Best univentionstaff 2015-02-17 11:59:17 CET
Additionally we could lowercase it in the backend + frontend code.
Comment 2 Florian Best univentionstaff 2015-02-17 15:36:45 CET
I applied the patch and configured a system → everything works.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2015-02-18 09:27:55 CET
> +msgstr "Der Rechnername ist kein gültiger FQDN (z.B. host.example.com)."

I think, we should avoid the term "FQDN" in german, as most users don't know, what is meant by that.


"Der Rechnername muss auch den Domänennamen enthalten (z.B. host.example.com)."
Comment 4 Dirk Wiesenthal univentionstaff 2015-04-27 15:04:08 CEST
Furthermore the hostname may start with a digit. And for optimization, the trailing "*" could also be a "?", I think.

The digit issue is a problem when docker is assigning hostnames automatically -> Errata.
Comment 5 Alexander Kramer univentionstaff 2015-06-03 10:27:04 CEST
r60983:

Adapted the message:
+"The hostname is not a valid fully qualified domain name (e.g. host.example.com)."
+"Der Rechnername muss auch den Domänennamen enthalten (z.B. host.example.com)."

Adapted the regex:
-is_hostname.RE = re.compile("^[a-z]([a-z0-9-]*[a-z0-9])*$")
+is_hostname.RE = re.compile("^[a-z0-9]([a-z0-9-]*[a-z0-9])?$", re.IGNORECASE)

r61019:
yaml file
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2015-06-19 15:22:45 CEST
I just noticed that my text suggestion may be irritating to the user if an invalid character is used for the FQDN (e.g. täst.example.com or test:example.com). I also looked up the correct translation for "FQDN". Therefore a new suggestion:
'The hostname is not a valid fully qualified domain name (e.g. host.example.com).'
→
'Der Rechnername ist kein gültiger und vollqualifizierter Domänenname (z.B. host.example.com)'

Despite that:

The following regex is used to check "domainname":
univention-system-setup/umc/python/setup/util.py:779:
is_domainname.RE = re.compile(r'^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$', re.I)

But the check message says, that the domainname should be all lower case which is not true:
univention-system-setup/umc/python/setup/__init__.py:393:
_check('domainname', util.is_domainname, _("Please enter a valid fully qualified domain name in lowercase (e.g. host.example.com)."))

→ Suggestion
"Please enter a valid fully qualified domain name (e.g. host.example.com)."
"Bitte geben Sie einen vollqualifizierten Domänenname an (z.B. host.example.com)."

It has to be discussed, if the german translation is understandable. In contrast to the first translation, the term "Rechnername" does not show up in the latter one.

OK: Regexp change
Comment 7 Alexander Kramer univentionstaff 2015-06-22 16:12:28 CEST
I adapted the changes as requested - but did not commit it yet - see below

> It has to be discussed, if the german translation is understandable. In
> contrast to the first translation, the term "Rechnername" does not show up
> in the latter one.


What is your opinion about this translation?:

"Bitte geben Sie als Rechnername eine vollqualifizierten Domäne an (z.B. host.example.com)."
Comment 8 Alexander Kramer univentionstaff 2015-06-22 16:27:05 CEST
As discussed with Erik, maybe we should prefer to rename the label
- 'vollständiger Rechnername' to
- 'vollqualifizierter Domänenname'

and remove the term Rechnername / hostname from the messages. Because the host is just a part of the domain name.
Comment 9 Alexander Kramer univentionstaff 2015-06-23 12:28:57 CEST
Implemented solution:

CASE 1: User is going to install a master
- host setting: The german translation for 'fully qualified domain name' is now 'vollqualifizierter Domänenname' instead of 'vollständiger Rechnername'

CASE 2: User is going to to install a non-master (backup, slave, member):
- host setting: The label and its translation is untoched: 'Hostname or fully qualified domain name'


CASE: Hostname is invalid
- i realized that the error message is only for the hostname. So i adapted the message as follows:

"The hostname or the hostname part of the fully qualified domain name is "
+"invalid. Please go back to the host setting and make sure, that the hostname "
+"only contains letter (a-zA-Z) and digits (0-9)."

+"Der Rechnername (im vollqualifizierten Domainnamen) ist ungültig. Bitte "
+"kehren Sie zu den Rechnereinstellungen zurück und überprüfen Sie, ob "
+"der Name ausschließlich Buchstaben (a-zA-Z) und Zahlen (0-9) enthält."

IMHO: I don't think that it is possible that a user will see this message, cause of the validation during the host settings.


debian/changelog
r61411
univention-system-setup (8.1.69-5) 
* Bug #37816: Adapted the messages as requested

r61415
yaml file
Comment 10 Sönke Schwardt-Krummrich univentionstaff 2015-07-01 13:53:20 CEST
> CASE 1: User is going to install a master
> - host setting: The german translation for 'fully qualified domain name' is
> now 'vollqualifizierter Domänenname' instead of 'vollständiger Rechnername'
→ OK

> "The hostname or the hostname part of the fully qualified domain name is "
> +"invalid. Please go back to the host setting and make sure, that the
> hostname "
> +"only contains letter (a-zA-Z) and digits (0-9)."
→ OK

> +"Der Rechnername (im vollqualifizierten Domainnamen) ist ungültig. Bitte "
> +"kehren Sie zu den Rechnereinstellungen zurück und überprüfen Sie, ob "
> +"der Name ausschließlich Buchstaben (a-zA-Z) und Zahlen (0-9) enthält."

Comitted small additional changes to german translation only:
- s/Domainnamen/Domänennamen/
- s/Zahlen/Ziffern/

 r61600 | Bug #37816: fixed german translation
univention-system-setup (8.1.69-8) 

A build of univention-system-setup is currently not possible due to a build error because of ongoing changes of bug #38780. Therefore the YAML file has not been updated.

The changelog message within the YAML file has been checked.
Comment 11 Janek Walkenhorst univentionstaff 2015-07-03 14:11:23 CEST
<http://errata.univention.de/ucs/4.0/220.html>