summaryrefslogtreecommitdiffstats
path: root/install/tools
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2016-04-15 13:22:25 +0200
committerMartin Basti <mbasti@redhat.com>2016-04-28 17:32:14 +0200
commit37865aa1d7d388042a3b8a66975b466ec27a3d38 (patch)
treedb0f431c13a0f2192b9cf92452ee5fe7addf4e6a /install/tools
parent3d07c889ce21ffe1d8baec3fd0c13bc67aa1d725 (diff)
downloadfreeipa-37865aa1d7d388042a3b8a66975b466ec27a3d38.tar.gz
freeipa-37865aa1d7d388042a3b8a66975b466ec27a3d38.tar.xz
freeipa-37865aa1d7d388042a3b8a66975b466ec27a3d38.zip
replica-manage: fail nicely when DM psswd required
Some commands do not allow anonymous bind and would fail with misleading message. https://fedorahosted.org/freeipa/ticket/4987 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'install/tools')
-rwxr-xr-xinstall/tools/ipa-replica-manage6
1 files changed, 5 insertions, 1 deletions
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index 6d1fc93c4..0bb9d158e 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -68,6 +68,9 @@ commands = {
"dnanextrange-set":(2, 2, "<master fqdn> <range>", "must provide a master and ID range"),
}
+# tuple of commands that need proper Directory Manager password
+dirman_passwd_req_commands = ("list-ruv", "clean-ruv", "abort-clean-ruv")
+
def parse_options():
parser = IPAOptionParser(version=version.VERSION)
@@ -1564,7 +1567,8 @@ def main(options, args):
if not test_connection(realm, host, options.nolookup):
dirman_passwd = installutils.read_password("Directory Manager",
confirm=False, validate=False, retry=False)
- if dirman_passwd is None:
+ if dirman_passwd is None or (
+ not dirman_passwd and args[0] in dirman_passwd_req_commands):
sys.exit("Directory Manager password required")
options.dirman_passwd = dirman_passwd