diff options
author | Martin Kosek <mkosek@redhat.com> | 2012-03-20 15:35:54 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-03-20 15:37:53 +0100 |
commit | 9d0ef96c670f0ddae12f4a4cbf12d9e4e58607da (patch) | |
tree | 79a48b79b9177318ba7adf4e46502b11729fbfbf | |
parent | f18cfd7de8e82d465cdd112decd262e6c901b2cb (diff) | |
download | freeipa-9d0ef96c670f0ddae12f4a4cbf12d9e4e58607da.tar.gz freeipa-9d0ef96c670f0ddae12f4a4cbf12d9e4e58607da.tar.xz freeipa-9d0ef96c670f0ddae12f4a4cbf12d9e4e58607da.zip |
Allow port numbers for idnsForwarders
Let user enter custom ports for zone conditional forwarders or
global forwarders in dnsconfig. Ports can be specified in
a standard BIND format: IP_ADDRESS [port PORT]
https://fedorahosted.org/freeipa/ticket/2462
-rw-r--r-- | freeipa.spec.in | 7 | ||||
-rw-r--r-- | ipalib/plugins/dns.py | 28 |
2 files changed, 29 insertions, 6 deletions
diff --git a/freeipa.spec.in b/freeipa.spec.in index de0c401b1..773afbb0e 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -160,8 +160,8 @@ Requires(postun): python initscripts chkconfig # We have a soft-requires on bind. It is an optional part of # IPA but if it is configured we need a way to require versions # that work for us. -Conflicts: bind-dyndb-ldap < 1.1.0-0.8.a2 -Conflicts: bind < 9.8.1-1 +Conflicts: bind-dyndb-ldap < 1.1.0-0.9.b1 +Conflicts: bind < 9.8.2-0.4.rc2 # mod_proxy provides a single API to communicate over SSL. If mod_ssl # is even loaded into Apache then it grabs this interface. @@ -686,6 +686,9 @@ fi %changelog +* Wed Mar 19 2012 Martin Kosek <mkosek@redhat.com> - 2.99.0-23 +- Set min for bind-dyndb-ldap and bind to pick up new features and bug fixes + * Thu Mar 1 2012 Jan Cholasta <jcholast@redhat.com> - 2.99.0-22 - Set min nvr of sssd to 1.8.0 for SSH support - Add BuildRequires on sssd >= 1.8.0 diff --git a/ipalib/plugins/dns.py b/ipalib/plugins/dns.py index a10960a2c..251db476e 100644 --- a/ipalib/plugins/dns.py +++ b/ipalib/plugins/dns.py @@ -348,6 +348,24 @@ def _dns_record_name_validator(ugettext, value): except ValueError, e: return unicode(e) +def _validate_bind_forwarder(ugettext, forwarder): + ip_address, sep, port = forwarder.partition(u' port ') + + ip_address_validation = _validate_ipaddr(ugettext, ip_address) + + if ip_address_validation is not None: + return ip_address_validation + + if sep: + try: + port = int(port) + if port < 0 or port > 65535: + raise ValueError() + except ValueError: + return _('%(port)s is not a valid port' % dict(port=port)) + + return None + def _domain_name_validator(ugettext, value): try: validate_domain_name(value) @@ -1614,10 +1632,11 @@ class dnszone(LDAPObject): autofill=True, ), Str('idnsforwarders*', - _validate_ipaddr, + _validate_bind_forwarder, cli_name='forwarder', label=_('Zone forwarders'), - doc=_('A list of zone forwarders'), + doc=_('A list of global forwarders. A custom port can be specified ' \ + 'for each forwarder using a standard format "IP_ADDRESS port PORT"'), csv=True, ), StrEnum('idnsforwardpolicy?', @@ -2628,10 +2647,11 @@ class dnsconfig(LDAPObject): takes_params = ( Str('idnsforwarders*', - _validate_ipaddr, + _validate_bind_forwarder, cli_name='forwarder', label=_('Global forwarders'), - doc=_('A list of global forwarders'), + doc=_('A list of global forwarders. A custom port can be specified ' \ + 'for each forwarder using a standard format "IP_ADDRESS port PORT"'), csv=True, ), ) |