Bug 35041 - Broken UDM syntax dnsName_umlauts for computers/windows
Broken UDM syntax dnsName_umlauts for computers/windows
Status: VERIFIED DUPLICATE of bug 25354
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.x
Assigned To: Philipp Hahn
Florian Best
:
Depends on:
Blocks: 53796
  Show dependency treegraph
 
Reported: 2014-06-02 17:38 CEST by Sönke Schwardt-Krummrich
Modified: 2021-09-15 22:51 CEST (History)
3 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 Sönke Schwardt-Krummrich univentionstaff 2014-06-02 17:38:01 CEST
The UDM syntax univention.admin.syntax.dnsName_umlauts is (amongst others) used in the UDM module computers/windows.py for checking hostnames seems to be broken.

class dnsName_umlauts(simple):
	regex = re.compile('(?u)(^\w[\w -.]*\w$)|\w*$')

>>> regex = re.compile('(?u)^\w[\w -.]*\w$')
>>> regex.match('''foo ( - " , ' _ ) bar''')
<_sre.SRE_Match object at 0x29176b0>
>>> regex.match(u'''foo ( - " ä , ü ' _ ) bar''')
<_sre.SRE_Match object at 0x2917850>

The part " -." specifies a character range which contains all characters between space and dot (e.g. ()"'-, ). So this does not look ok to me.

Side note: the second alternative "\w*$" of the regex should use ^ otherwise it would match to any string if re.search() is used instead of re.match().
Comment 1 Philipp Hahn univentionstaff 2016-11-28 09:54:05 CET

*** This bug has been marked as a duplicate of bug 25354 ***
Comment 2 Florian Best univentionstaff 2016-12-23 15:29:23 CET
OK