From 951265d55899816f9c944ddb831473fedca2997b Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Wed, 25 Sep 2013 08:40:05 +0000 Subject: Allow PKCS#12 files with empty password in install tools. https://fedorahosted.org/freeipa/ticket/3897 --- install/tools/ipa-server-install | 12 ++++++------ ipaserver/install/ipa_replica_prepare.py | 8 ++++---- ipaserver/install/ipa_server_certinstall.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index aa424c37..0374efea 100644 --- a/install/tools/ipa-server-install +++ b/install/tools/ipa-server-install @@ -274,11 +274,11 @@ def parse_options(): "PKCS#12 options are used.") if options.unattended: - if options.dirsrv_pkcs12 and not options.dirsrv_pin: + if options.dirsrv_pkcs12 and options.dirsrv_pin is None: parser.error("You must specify --dirsrv_pin with --dirsrv_pkcs12") - if options.http_pkcs12 and not options.http_pin: + if options.http_pkcs12 and options.http_pin is None: parser.error("You must specify --http_pin with --http_pkcs12") - if options.pkinit_pkcs12 and not options.pkinit_pin: + if options.pkinit_pkcs12 and options.pkinit_pin is None: parser.error("You must specify --pkinit_pin with --pkinit_pkcs12") if options.dirsrv_pkcs12 and not options.root_ca_file: @@ -876,7 +876,7 @@ def main(): ca_file = options.root_ca_file if options.http_pkcs12: - if not options.http_pin: + if options.http_pin is None: options.http_pin = installutils.read_password( "Enter %s unlock" % options.http_pkcs12, confirm=False, validate=False) @@ -887,7 +887,7 @@ def main(): http_pkcs12_info, ca_file, host_name) if options.dirsrv_pkcs12: - if not options.dirsrv_pin: + if options.dirsrv_pin is None: options.dirsrv_pin = installutils.read_password( "Enter %s unlock" % options.dirsrv_pkcs12, confirm=False, validate=False) @@ -898,7 +898,7 @@ def main(): dirsrv_pkcs12_info, ca_file, host_name) if options.pkinit_pkcs12: - if not options.pkinit_pin: + if options.pkinit_pin is None: options.pkinit_pin = installutils.read_password( "Enter %s unlock" % options.pkinit_pkcs12, confirm=False, validate=False) diff --git a/ipaserver/install/ipa_replica_prepare.py b/ipaserver/install/ipa_replica_prepare.py index 55b81eee..36d078a6 100644 --- a/ipaserver/install/ipa_replica_prepare.py +++ b/ipaserver/install/ipa_replica_prepare.py @@ -209,7 +209,7 @@ class ReplicaPrepare(admintool.AdminTool): raise admintool.ScriptError("Invalid reverse zone") if options.http_pkcs12: - if not options.http_pin: + if options.http_pin is None: options.http_pin = installutils.read_password( "Enter %s unlock" % options.http_pkcs12, confirm=False, validate=False) @@ -219,7 +219,7 @@ class ReplicaPrepare(admintool.AdminTool): self.check_pkcs12(options.http_pkcs12, options.http_pin) if options.dirsrv_pkcs12: - if not options.dirsrv_pin: + if options.dirsrv_pin is None: options.dirsrv_pin = installutils.read_password( "Enter %s unlock" % options.dirsrv_pkcs12, confirm=False, validate=False) @@ -229,7 +229,7 @@ class ReplicaPrepare(admintool.AdminTool): self.check_pkcs12(options.dirsrv_pkcs12, options.dirsrv_pin) if options.pkinit_pkcs12: - if not options.pkinit_pin: + if options.pkinit_pin is None: options.pkinit_pin = installutils.read_password( "Enter %s unlock" % options.pkinit_pkcs12, confirm=False, validate=False) @@ -239,7 +239,7 @@ class ReplicaPrepare(admintool.AdminTool): if (not ipautil.file_exists( dogtag.configured_constants().CS_CFG_PATH) and - not options.dirsrv_pin): + options.dirsrv_pin is None): self.log.info("If you installed IPA with your own certificates " "using PKCS#12 files you must provide PKCS#12 files for any " "replicas you create as well.") diff --git a/ipaserver/install/ipa_server_certinstall.py b/ipaserver/install/ipa_server_certinstall.py index 1aa27b2e..87c4eaf1 100644 --- a/ipaserver/install/ipa_server_certinstall.py +++ b/ipaserver/install/ipa_server_certinstall.py @@ -87,7 +87,7 @@ class ServerCertInstall(admintool.AdminTool): raise admintool.ScriptError( "Directory Manager password required") - if not self.options.pin: + if self.options.pin is None: self.options.pin = installutils.read_password( "Enter %s unlock" % self.args[0], confirm=False, validate=False) if self.options.pin is None: -- cgit