Univention Bugzilla – Bug 35041
Broken UDM syntax dnsName_umlauts for computers/windows
Last modified: 2021-09-15 22:51:10 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().
*** This bug has been marked as a duplicate of bug 25354 ***
OK