Limit allowed characters in a netgroup name to alpha, digit, -, _ and .

Apply this to hostgroup names as well since they can be linked.

https://fedorahosted.org/freeipa/ticket/2221
This commit is contained in:
Rob Crittenden committed 2012-02-27 00:06:44 -05:00
1 parent a09063cbb8
commit 7d7322de2e
5 files changed
+41 -14

No files matched your search

@@ -36,6 +36,8 @@ fqdn1 = u'testhost1.%s' % api.env.domain
host_dn1 = DN(('fqdn',fqdn1),('cn','computers'),('cn','accounts'),
api.env.basedn)
invalidhostgroup1 = u'@invalid'
class test_hostgroup(Declarative):
@@ -69,6 +71,13 @@ class test_hostgroup(Declarative):
),
dict(
desc='Test an invalid hostgroup name %r' % invalidhostgroup1,
command=('hostgroup_add', [invalidhostgroup1], dict(description=u'Test')),
expected=errors.ValidationError(name='cn', error='may only include letters, numbers, _, - and .'),
),
dict(
desc='Create %r' % hostgroup1,
command=('hostgroup_add', [hostgroup1],