mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
3d07c889ce
commit
37865aa1d7
@ -68,6 +68,9 @@ commands = {
|
|||||||
"dnanextrange-set":(2, 2, "<master fqdn> <range>", "must provide a master and ID range"),
|
"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():
|
def parse_options():
|
||||||
parser = IPAOptionParser(version=version.VERSION)
|
parser = IPAOptionParser(version=version.VERSION)
|
||||||
@ -1564,7 +1567,8 @@ def main(options, args):
|
|||||||
if not test_connection(realm, host, options.nolookup):
|
if not test_connection(realm, host, options.nolookup):
|
||||||
dirman_passwd = installutils.read_password("Directory Manager",
|
dirman_passwd = installutils.read_password("Directory Manager",
|
||||||
confirm=False, validate=False, retry=False)
|
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")
|
sys.exit("Directory Manager password required")
|
||||||
|
|
||||||
options.dirman_passwd = dirman_passwd
|
options.dirman_passwd = dirman_passwd
|
||||||
|
Loading…
Reference in New Issue
Block a user