Univention Bugzilla – Bug 37816
system setup allows only lowercase hostnames
Last modified: 2015-08-11 09:23:42 CEST
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
Additionally we could lowercase it in the backend + frontend code.
I applied the patch and configured a system → everything works.
> +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)."
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.
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
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
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)."
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.
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
> 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.
<http://errata.univention.de/ucs/4.0/220.html>