summaryrefslogtreecommitdiffstats
path: root/install/tools
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2011-06-08 14:39:50 +0200
committerMartin Kosek <mkosek@redhat.com>2011-06-13 12:59:22 +0200
commitd2b483cbb3ca15a68115cf32cfaf89572259914e (patch)
tree1661f3021e3b0b3cc54f75af68f044171f363d3e /install/tools
parent645e55651e866f74b76108fe298526daaffb18ce (diff)
downloadfreeipa-d2b483cbb3ca15a68115cf32cfaf89572259914e.tar.gz
freeipa-d2b483cbb3ca15a68115cf32cfaf89572259914e.tar.xz
freeipa-d2b483cbb3ca15a68115cf32cfaf89572259914e.zip
Fix directory manager password validation in ipa-nis-manage.
ticket 1283, 1284
Diffstat (limited to 'install/tools')
-rwxr-xr-xinstall/tools/ipa-nis-manage10
1 files changed, 8 insertions, 2 deletions
diff --git a/install/tools/ipa-nis-manage b/install/tools/ipa-nis-manage
index 69db06ab8..2c0936b49 100755
--- a/install/tools/ipa-nis-manage
+++ b/install/tools/ipa-nis-manage
@@ -62,7 +62,7 @@ def get_dirman_password():
"""Prompt the user for the Directory Manager password and verify its
correctness.
"""
- password = installutils.read_password("Directory Manager", confirm=False, validate=False)
+ password = installutils.read_password("Directory Manager", confirm=False, validate=False, retry=False)
return password
@@ -101,11 +101,17 @@ def main():
dirman_password = ""
if options.password:
- pw = ipautil.template_file(options.password, [])
+ try:
+ pw = ipautil.template_file(options.password, [])
+ except IOError:
+ sys.exit("File \"%s\" not found or not readable" % options.password)
dirman_password = pw.strip()
else:
dirman_password = get_dirman_password()
+ if not dirman_password:
+ sys.exit("No password supplied")
+
api.bootstrap(context='cli', debug=options.debug)
api.finalize()