Prevent changing protected group's name using --setattr

The name of any protected group now cannot be changed by modifing
the cn attribute using --setattr. Unit tests have been added to
make sure there is no regression.

https://fedorahosted.org/freeipa/ticket/3354
This commit is contained in:
Tomas Babej
2013-02-11 10:19:53 +01:00
committed by Rob Crittenden
parent 462beacc9d
commit 5b64cde92a
2 changed files with 16 additions and 1 deletions

View File

@@ -265,7 +265,7 @@ class group_mod(LDAPUpdate):
is_protected_group = keys[-1] in PROTECTED_GROUPS
if 'rename' in options:
if 'rename' in options or 'cn' in entry_attrs:
if is_protected_group:
raise errors.ProtectedEntryError(label=u'group', key=keys[-1],
reason=u'Cannot be renamed')