mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't allow a OTP to be set on an enrolled host
Setting a password invalidates the existing keytab https://fedorahosted.org/freeipa/ticket/1719
This commit is contained in:
parent
9c4b004076
commit
c97eb871c5
@ -604,6 +604,14 @@ class host_mod(LDAPUpdate):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options):
|
||||||
|
# Allow an existing OTP to be reset but don't allow a OTP to be
|
||||||
|
# added to an enrolled host.
|
||||||
|
if 'userpassword' in options:
|
||||||
|
entry = {}
|
||||||
|
self.obj.get_password_attributes(ldap, dn, entry)
|
||||||
|
if not entry['has_password'] and entry['has_keytab']:
|
||||||
|
raise errors.ValidationError(name='password', error=_('Password cannot be set on enrolled host.'))
|
||||||
|
|
||||||
# Once a principal name is set it cannot be changed
|
# Once a principal name is set it cannot be changed
|
||||||
if 'cn' in entry_attrs:
|
if 'cn' in entry_attrs:
|
||||||
raise errors.ACIError(info='cn is immutable')
|
raise errors.ACIError(info='cn is immutable')
|
||||||
|
Loading…
Reference in New Issue
Block a user