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:40 +0200 |
commit | a27a820221634fc0e0489a8c2dab3f0e914daa2c (patch) | |
tree | 6d458f87202f122bb5b320827c94a6aadeadb9aa /ipalib | |
parent | 2be04c6e7fc281bb68f78f78a77718a3d963e789 (diff) | |
download | freeipa-a27a820221634fc0e0489a8c2dab3f0e914daa2c.tar.gz freeipa-a27a820221634fc0e0489a8c2dab3f0e914daa2c.tar.xz freeipa-a27a820221634fc0e0489a8c2dab3f0e914daa2c.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')
-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, |