diff options
author | Martin Kosek <mkosek@redhat.com> | 2011-10-06 08:22:08 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-10-06 08:28:15 +0200 |
commit | 185ca8f6fc5e69e989e473c8b1d066aa2d8e5cb1 (patch) | |
tree | 5e74685f51c038463b24e9de7fe231fd84fc5c3e /install/tools/ipa-replica-manage | |
parent | 7d5106de976140e8425152a83a300be9dc49372a (diff) | |
download | freeipa-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-manage')
-rwxr-xr-x | install/tools/ipa-replica-manage | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage index c3dd0b3fe..84cfd8f3e 100755 --- a/install/tools/ipa-replica-manage +++ b/install/tools/ipa-replica-manage @@ -20,7 +20,7 @@ import sys import os -import getpass, ldap, re, krbV +import ldap, re, krbV import traceback, logging from ipapython import ipautil @@ -444,7 +444,10 @@ def main(): dirman_passwd = options.dirman_passwd else: if not test_connection(realm, host): - dirman_passwd = getpass.getpass("Directory Manager password: ") + dirman_passwd = installutils.read_password("Directory Manager", + confirm=False, validate=False, retry=False) + if dirman_passwd is None: + sys.exit("\nDirectory Manager password required") options.dirman_passwd = dirman_passwd |