Don't allow host cn to be changed (it isn't used anyway).

We are required by LDAP schema to have a cn value. Don't let
users change it thinking they are actually doing something.

tickets 706 and 707
This commit is contained in:
Rob Crittenden 2011-02-15 15:04:40 -05:00
parent 2f0e8e3a3d
commit 86fe47b87d

View File

@ -533,6 +533,8 @@ class host_mod(LDAPUpdate):
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
# Once a principal name is set it cannot be changed
if 'cn' in entry_attrs:
raise errors.ACIError(info='cn is immutable')
if 'locality' in entry_attrs:
entry_attrs['l'] = entry_attrs['locality']
del entry_attrs['locality']