summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-server-certinstall
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2011-10-06 08:22:08 +0200
committerMartin Kosek <mkosek@redhat.com>2011-10-06 08:28:34 +0200
commit45212301f2406be96117e9a7604b95849a57f85b (patch)
treecd219a2e8c575e4642608faf4e2c0df2b28ee0c6 /install/tools/ipa-server-certinstall
parent5de97801aab2e8e4fd41b8ab4e914e6ca0b1f781 (diff)
downloadfreeipa-45212301f2406be96117e9a7604b95849a57f85b.tar.gz
freeipa-45212301f2406be96117e9a7604b95849a57f85b.tar.xz
freeipa-45212301f2406be96117e9a7604b95849a57f85b.zip
Install tools crash when password prompt is interrupted
When getpass.getpass() function is interrupted via CTRL+D, EOFError exception is thrown. Most of the install tools are not prepared for this event and crash with this exception. Make sure that it is handled properly and nice error message is printed. https://fedorahosted.org/freeipa/ticket/1916
Diffstat (limited to 'install/tools/ipa-server-certinstall')
-rwxr-xr-xinstall/tools/ipa-server-certinstall8
1 files changed, 5 insertions, 3 deletions
diff --git a/install/tools/ipa-server-certinstall b/install/tools/ipa-server-certinstall
index 312d41202..901678b2e 100755
--- a/install/tools/ipa-server-certinstall
+++ b/install/tools/ipa-server-certinstall
@@ -25,14 +25,13 @@ import tempfile
import traceback
-import krbV, getpass
+import krbV
from ipapython.ipautil import user_input
from ipaserver.install import certs, dsinstance, httpinstance, installutils
from ipalib import api
from ipaserver.plugins.ldap2 import ldap2
-from ipaserver.install import installutils
def get_realm_name():
c = krbV.default_context()
@@ -132,7 +131,10 @@ def main():
try:
if options.dirsrv:
- dm_password = getpass.getpass("Directory Manager password: ")
+ dm_password = installutils.read_password("Directory Manager",
+ confirm=False, validate=False, retry=False)
+ if dm_password is None:
+ sys.exit("\nDirectory Manager password required")
realm = get_realm_name()
dirname = dsinstance.config_dirname(dsinstance.realm_to_serverid(realm))
fd = open(dirname + "/pwdfile.txt")