diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-09-12 13:51:31 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-09-27 16:08:26 +0200 |
commit | 8cf8870d3d11ace41cea1649d41f84341e0e94ac (patch) | |
tree | f17a4ee209fb723d3a4fbfb218f08b3affc34faf /ipalib/plugins | |
parent | 6aa5bfe5db3b44197b181cf138c8f257b622e8b4 (diff) | |
download | freeipa-8cf8870d3d11ace41cea1649d41f84341e0e94ac.tar.gz freeipa-8cf8870d3d11ace41cea1649d41f84341e0e94ac.tar.xz freeipa-8cf8870d3d11ace41cea1649d41f84341e0e94ac.zip |
Add regular expression pattern to host names.
Limit hostnames to letters, digits and - with a maximum length of 255
https://fedorahosted.org/freeipa/ticket/1780
Diffstat (limited to 'ipalib/plugins')
-rw-r--r-- | ipalib/plugins/host.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py index 01a8240e3..52907eebe 100644 --- a/ipalib/plugins/host.py +++ b/ipalib/plugins/host.py @@ -247,6 +247,9 @@ class host(LDAPObject): takes_params = ( Str('fqdn', validate_host, + pattern='^[a-zA-Z0-9][a-zA-Z0-9-\.]{0,254}$', + pattern_errmsg='may only include letters, numbers, and -', + maxlength=255, cli_name='hostname', label=_('Host name'), primary_key=True, |