summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/dns.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-11-14 17:03:44 +0100
committerMartin Kosek <mkosek@redhat.com>2011-11-15 13:17:44 +0100
commit2a3a4ae64a9c3fa41520058e24f20f4d3d941e48 (patch)
tree3c51f7b993602df309269244c429f85974b86ec2 /ipalib/plugins/dns.py
parent714b0d11ec5e6d756739bfca2cdf3bad31979615 (diff)
downloadfreeipa.git-2a3a4ae64a9c3fa41520058e24f20f4d3d941e48.tar.gz
freeipa.git-2a3a4ae64a9c3fa41520058e24f20f4d3d941e48.tar.xz
freeipa.git-2a3a4ae64a9c3fa41520058e24f20f4d3d941e48.zip
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
Diffstat (limited to 'ipalib/plugins/dns.py')
-rw-r--r--ipalib/plugins/dns.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py
index 0a0bcb79..bfc8090c 100644
--- a/ipalib/plugins/dns.py
+++ b/ipalib/plugins/dns.py
@@ -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)