Univention Bugzilla – Bug 34552
Mail domain name not validated
Last modified: 2015-03-25 16:43:49 CET
Syntax of mail/domain's name property is string. So no further checks. But as the name is part of the domain's DN, certain characters are not allowed. If giving a "wrong" domain name, UDM just says: The LDAP object could not be saved: LDAP Error Invalid DN syntax: invalid DN This is an LDAP error not a UDM one. Not a big issue but the user sees a cryptic error message instead of an invalid "name" widget (like in users/user's username).
The manual says: "The name of a mail domain may only be composed of lowercase letters, the figures 0-9, full stops and hyphens." This really should be validated. In my tests, I could create an arbitrary mail domain without any error occurring.
r 59126 added a new syntax class to validate the mail domain name. Also adpated the de.po for the german translation debian/changelog univention-directory-manager-modules (10.0.29-34) * Bug #34552: Validate the mail domain name Successful build Package: univention-directory-manager-modules Version: 10.0.29-34.1298.201503171542 Branch: ucs_4.0-0 Scope: errata4.0-1 r 59127 yaml file
If you want to restore the old behavior/syntax class you can overwrite the syntax from the cli: ucr set directory/manager/web/modules/mail/domain/properties/name/syntax='string' Also added this information to the yaml file: r 59130
As requested I changed the error messages and fixed the regex statement. r 59134 debian/changelog univention-directory-manager-modules (10.0.29-35) * Bug #34552: Adapted the regex and the messages Successful build Package: univention-directory-manager-modules Version: 10.0.29-35.1299.201503171648 Branch: ucs_4.0-0 Scope: errata4.0-1 Host: dimma.knut.univention.de Logfile Path: /var/univention/buildsystem2/logs/ucs_4.0-0-0-errata4.0-1/ucs_4.0-0-errata4.0-1.univention-directory-manager-modules.201503171648.log.bz2 r 59136 yaml file adapted the fix number
REOPEN: code change The reg exp within the syntax matches also to the empty string which is not desired. Besides that, there is already an existing syntax class that IMHO fits better: "DNS_Name" Currently I cannot see any reason why this syntax class should not be reused.
(In reply to Sönke Schwardt-Krummrich from comment #5) > REOPEN: code change > > The reg exp within the syntax matches also to the empty string which is not > desired. Besides that, there is already an existing syntax class that IMHO > fits better: "DNS_Name" > Currently I cannot see any reason why this syntax class should not be reused. Agreed. I take this bug such that it can be published tomorrow. univention-directory-manager-modules (10.0.29-36) [r59362]: * Bug #34552: replace mail_domain_name syntax with DNS_Name
OK: fix [en|ger] OK: YAML
<http://errata.univention.de/ucs/4.0/122.html>