Univention Bugzilla – Bug 38734
inconsistencies in hostname syntax definitions
Last modified: 2018-02-16 09:43:54 CET
While doing the QA for Bug #37816 I noticed some inconsistencies in syntax.py: class hostName: regex = re.compile("(^[a-zA-Z0-9])(([a-zA-Z0-9-_]*)([a-zA-Z0-9]$))?$") class hostOrIP: _re = re.compile("(^[a-zA-Z])(([a-zA-Z0-9-]*)([a-zA-Z0-9]$))?$") → contains it's own regex for the "hostname check" → why not reusing hostName.regex class hostname_or_ipadress_or_network: [sic!] → reuses regex of hostOrIP → typo in class name (→ "ipad*d*ress") +++ This bug was initially created as a clone of Bug #37816 +++ 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
See svn:ucs-4.2-0@74821 = git:b82b0a3b30c: 1076 class hostOrIP(simple): ... 1101 »···def hostName(self, text): 1102 »···»···if text and hostName.regex.match(text) is not None: ... 1108 »···def parse(self, text): 1109 »···»···if self.hostName(text) or self.ipAddress(text): ... 3563 class hostname_or_ipadress_or_network(simple): ... 3590 »···def parse(self, text): ... 3595 »···»···»···»···hostOrIP.parse(text) *** This bug has been marked as a duplicate of bug 25354 ***