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:15 +0200
commit185ca8f6fc5e69e989e473c8b1d066aa2d8e5cb1 (patch)
tree5e74685f51c038463b24e9de7fe231fd84fc5c3e /install/tools/ipa-replica-conncheck
parent7d5106de976140e8425152a83a300be9dc49372a (diff)
downloadfreeipa-185ca8f6fc5e69e989e473c8b1d066aa2d8e5cb1.tar.gz
freeipa-185ca8f6fc5e69e989e473c8b1d066aa2d8e5cb1.tar.xz
freeipa-185ca8f6fc5e69e989e473c8b1d066aa2d8e5cb1.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 09567d6eb..e9d78a065 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],