diff options
-rwxr-xr-x | source4/scripting/devel/ldapcmp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source4/scripting/devel/ldapcmp b/source4/scripting/devel/ldapcmp index 76b4e8eec6..edf37d36d0 100755 --- a/source4/scripting/devel/ldapcmp +++ b/source4/scripting/devel/ldapcmp @@ -518,13 +518,10 @@ class LDAPBundel(object): if __name__ == "__main__": parser = OptionParser("ldapcmp [options] domain|configuration|schema") sambaopts = options.SambaOptions(parser) + parser.add_option_group(sambaopts) credopts = options.CredentialsOptionsDouble(parser) parser.add_option_group(credopts) - lp = sambaopts.get_loadparm() - creds = credopts.get_credentials(lp) - creds2 = credopts.get_credentials2(lp) - parser.add_option("", "--host", dest="host", help="IP of the first LDAP server",) parser.add_option("", "--host2", dest="host2", @@ -537,6 +534,15 @@ if __name__ == "__main__": help="Print all DN pairs that have been compared",) (opts, args) = parser.parse_args() + lp = sambaopts.get_loadparm() + creds = credopts.get_credentials(lp) + creds2 = credopts.get_credentials2(lp) + if creds2.is_anonymous(): + creds2 = creds + + if creds.is_anonymous(): + parser.error("You must supply at least one username/password pair") + if not (len(args) == 1 and args[0].upper() in ["DOMAIN", "CONFIGURATION", "SCHEMA"]): parser.error("Incorrect arguments") |