summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-27 22:03:07 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-28 00:16:37 +1100
commitaf93f227ad5341b2ceaaa26d0d07ffa1dd9f9aa8 (patch)
tree7eafe2926fad49e82a674144efa8d8ac0964ba20 /source4/scripting
parent6a781b52867900bc6085721fd0e2ededa4f98f50 (diff)
downloadsamba-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>
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/getopt.py6
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)