Bug 38734 - inconsistencies in hostname syntax definitions
inconsistencies in hostname syntax definitions
Status: RESOLVED DUPLICATE of bug 25354
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-x
Assigned To: Philipp Hahn
:
Depends on: 37816
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-19 15:33 CEST by Sönke Schwardt-Krummrich
Modified: 2018-02-16 09:43 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.103
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 Sönke Schwardt-Krummrich univentionstaff 2015-06-19 15:33:20 CEST
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
Comment 1 Philipp Hahn univentionstaff 2018-02-16 09:43:54 CET
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 ***