mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix LDAP object parameter encoding
Parameters in LDAP objects missed an information if they are real LDAP attributes or not. Real LDAP attributes are written to entry_attrs dictionary in plugin callbacks and are being encoded. This causes issues when plugin callbacks does not expect that the parameters values are already encoded for submission to LDAP. This patch introduces a new flag "noattribute" used to mark that a parameter is not an LDAP attribute and thus should not be encoded or added to entry_attrs. Param documentation is improved to describe the meaning of this and other Param flags or attributes. https://fedorahosted.org/freeipa/ticket/2097
This commit is contained in:
@@ -665,6 +665,7 @@ class dnszone(LDAPObject):
|
||||
Str('name_from_ip?', _validate_ipnet,
|
||||
label=_('Reverse zone IP network'),
|
||||
doc=_('IP network to create reverse zone name from'),
|
||||
flags=('virtual_attribute',),
|
||||
),
|
||||
Str('idnssoamname',
|
||||
cli_name='name_server',
|
||||
@@ -780,9 +781,6 @@ class dnszone_add(LDAPCreate):
|
||||
if not dns_container_exists(self.api.Backend.ldap2):
|
||||
raise errors.NotFound(reason=_('DNS is not configured'))
|
||||
|
||||
if 'name_from_ip' in entry_attrs:
|
||||
del entry_attrs['name_from_ip']
|
||||
|
||||
entry_attrs['idnszoneactive'] = 'TRUE'
|
||||
|
||||
# Check nameserver has a forward record
|
||||
@@ -832,11 +830,6 @@ class dnszone_mod(LDAPUpdate):
|
||||
self.obj.params['name_from_ip'](unicode(options['name_from_ip']))
|
||||
return super(dnszone_mod, self).args_options_2_params(*args, **options)
|
||||
|
||||
def pre_callback(self, ldap, dn, entry_attrs, *keys, **options):
|
||||
if 'name_from_ip' in entry_attrs:
|
||||
del entry_attrs['name_from_ip']
|
||||
return dn
|
||||
|
||||
api.register(dnszone_mod)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user