diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-11-27 22:03:07 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-11-28 00:16:37 +1100 |
commit | af93f227ad5341b2ceaaa26d0d07ffa1dd9f9aa8 (patch) | |
tree | 7eafe2926fad49e82a674144efa8d8ac0964ba20 | |
parent | 6a781b52867900bc6085721fd0e2ededa4f98f50 (diff) | |
download | samba-af93f227ad5341b2ceaaa26d0d07ffa1dd9f9aa8.tar.gz samba-af93f227ad5341b2ceaaa26d0d07ffa1dd9f9aa8.tar.bz2 samba-af93f227ad5341b2ceaaa26d0d07ffa1dd9f9aa8.zip |
s4-samba-tool: fixed "-k no" for disabling kerberos auth
The option "-k no" was not correctly disabling kerberos in python
programs
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source4/scripting/python/samba/getopt.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py index 08fe692ce0..8104faf62e 100644 --- a/source4/scripting/python/samba/getopt.py +++ b/source4/scripting/python/samba/getopt.py @@ -135,10 +135,12 @@ class CredentialsOptions(optparse.OptionGroup): self.ipaddress = arg def _set_kerberos(self, option, opt_str, arg, parser): - if bool(arg) or arg.lower() == "yes": + if arg.lower() in ["yes", 'true', '1']: self.creds.set_kerberos_state(MUST_USE_KERBEROS) - else: + elif arg.lower() in ["no", 'false', '0']: self.creds.set_kerberos_state(DONT_USE_KERBEROS) + else: + raise optparse.BadOptionErr("invalid kerberos option: %s" % arg) def _set_simple_bind_dn(self, option, opt_str, arg, parser): self.creds.set_bind_dn(arg) |