--kerberos option

Jelmer Vernooij jelmer at samba.org
Tue Oct 11 15:57:34 MDT 2011


On 10/11/2011 11:50 PM, Giampaolo Lauria wrote:
> Hi Andrew,
>
> I was wondering whether I could change the --kerberos credential option to
> be a boolean. Currently, it takes an argument which value could be in
> (yes,true,1,no, false,0). Also, what should the value of the kerberos
> state if the option is not specified?
The default is auto (AUTO_USE_KERBEROS), which means that kerberos will
be used if possible.
>
>
> Following is the code that handles the option:
>
> def _set_kerberos(self, option, opt_str, arg, parser):
> if arg.lower() in ["yes", 'true', '1']:
> self.creds.set_kerberos_state(MUST_USE_KERBEROS)
> elif arg.lower() in ["no", 'false', '0']:
> self.creds.set_kerberos_state(DONT_USE_KERBEROS)
> else:
> raise optparse.BadOptionErr("invalid kerberos option: %s" %
> arg)
>
> the option help says: "use kerberos", so why should the user specify a
> value?
Specifying "no" allows them to explicitly forbid Kerberos (rather than
allowing it if it is available).

>
> Also, optparse.BadOptionErr does not exist and specifying a value for this
> option other than the ones above causes an ugly error.
My bad, that should be optparse.BadOptionError. I've pushed a fix to
autobuild.

Cheers,

Jelmer



More information about the samba-technical mailing list