summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-replica-conncheck
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-replica-conncheck
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-replica-conncheck')
-rwxr-xr-xinstall/tools/ipa-replica-conncheck8
1 files changed, 6 insertions, 2 deletions
diff --git a/install/tools/ipa-replica-conncheck b/install/tools/ipa-replica-conncheck
index 65d7ef506..d9a52ac47 100755
--- a/install/tools/ipa-replica-conncheck
+++ b/install/tools/ipa-replica-conncheck
@@ -22,6 +22,7 @@ from ipapython.config import IPAOptionParser
from ipapython import version
from ipapython import ipautil
from ipapython.ipautil import CalledProcessError
+from ipaserver.install import installutils
import ipaclient.ipachangeconf
from optparse import OptionGroup
import logging
@@ -29,7 +30,6 @@ import sys
import os
import signal
import tempfile
-import getpass
import socket
import time
import threading
@@ -314,7 +314,11 @@ def main():
if options.password:
password=options.password
else:
- password = getpass.getpass("Password for %s: " % principal)
+ password = installutils.read_password(principal, confirm=False,
+ validate=False, retry=False)
+ if password is None:
+ sys.exit("\nPrincipal password required")
+
stderr=''
(stdout, stderr, returncode) = ipautil.run(['/usr/bin/kinit', principal],