summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-10-24 18:35:48 +0200
committerMartin Kosek <mkosek@redhat.com>2011-10-26 08:52:50 +0200
commitb26d0dcc04e821543b8582328e99e630b752768f (patch)
treea6e2e651260456ab6147f61217561dac9fdbeca0 /install
parent9bdbdbc0f32b87d0fcdc2b9faa98e7c674b2464d (diff)
downloadfreeipa-b26d0dcc04e821543b8582328e99e630b752768f.tar.gz
freeipa-b26d0dcc04e821543b8582328e99e630b752768f.tar.xz
freeipa-b26d0dcc04e821543b8582328e99e630b752768f.zip
Add --zonemgr/--admin-mail validator
Do at least a basic validation of DNS zone manager mail address. Do not require '@' to be in the mail address as the SOA record stores this value without it and people may be used to configure it that way. '@' is always removed by the installer/dns plugin before the DNS zone is created. https://fedorahosted.org/freeipa/ticket/1966
Diffstat (limited to 'install')
-rwxr-xr-xinstall/tools/ipa-dns-install3
-rwxr-xr-xinstall/tools/ipa-server-install13
2 files changed, 3 insertions, 13 deletions
diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index d81b6a2e8..7841c21dc 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -48,7 +48,8 @@ def parse_options():
parser.add_option("--reverse-zone", dest="reverse_zone", help="The reverse DNS zone to use")
parser.add_option("--no-reverse", dest="no_reverse", action="store_true",
default=False, help="Do not create reverse DNS zone")
- parser.add_option("--zonemgr", dest="zonemgr",
+ parser.add_option("--zonemgr", action="callback", callback=bindinstance.zonemgr_callback,
+ type="string",
help="DNS zone manager e-mail address. Defaults to root")
parser.add_option("--zone-notif", dest="zone_notif",
action="store_true", default=False,
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 76d5f2f5a..d29b806da 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -58,7 +58,6 @@ from ipaserver.plugins.ldap2 import ldap2
from ipapython import sysrestore
from ipapython.ipautil import *
from ipalib import api, errors, util
-from ipalib.parameters import IA5Str
from ipapython.config import IPAOptionParser
from ipalib.dn import DN
from ipalib.x509 import load_certificate_from_file, load_certificate_chain_from_file
@@ -76,16 +75,6 @@ VALID_SUBJECT_ATTRS = ['cn', 'st', 'o', 'ou', 'dnqualifier', 'c',
'incorporationlocality', 'incorporationstate',
'incorporationcountry', 'businesscategory']
-def zonemgr_callback(option, opt_str, value, parser):
- """
- Make sure the zonemgr is an IA5String.
- """
- name = opt_str.replace('--','')
- v = unicode(value, 'utf-8')
- ia = IA5Str(name)
- ia._convert_scalar(v)
- parser.values.zonemgr = value
-
def subject_callback(option, opt_str, value, parser):
"""
Make sure the certificate subject base is a valid DN
@@ -195,7 +184,7 @@ def parse_options():
dns_group.add_option("--reverse-zone", dest="reverse_zone", help="The reverse DNS zone to use")
dns_group.add_option("--no-reverse", dest="no_reverse", action="store_true",
default=False, help="Do not create reverse DNS zone")
- dns_group.add_option("--zonemgr", action="callback", callback=zonemgr_callback,
+ dns_group.add_option("--zonemgr", action="callback", callback=bindinstance.zonemgr_callback,
type="string",
help="DNS zone manager e-mail address. Defaults to root")
dns_group.add_option("--zone-notif", dest="zone_notif",