The branch, master has been updated via d5af819... s4:auth/credentials/credentials.c - Initialise the "lm_response" and "nt_response" structures via de55589... s4:getopt.py - set the password callback only when no password has been provided from e82ac86... s4:net_drs_bind: make some more stuff static
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit d5af819b1a1f293dda108e77b4dfb64afb894035 Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de> Date: Fri Feb 12 14:58:27 2010 +0100 s4:auth/credentials/credentials.c - Initialise the "lm_response" and "nt_response" structures In some cases those structures are not initialised and the whole authentication system crashes with a SIGSEGV. Bug discovered by Matthieu Patou in bug #6755. commit de555895e59ffa691b5c8e910fe0d93cacc9281e Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de> Date: Fri Feb 12 13:55:14 2010 +0100 s4:getopt.py - set the password callback only when no password has been provided Previously the "no_pass" and "no_pass2" variables weren't handled correctly. Since at the initialisation of the "CredentialsOptions" we don't have any password at all. Only afterwards we could get one through "set_password". If a password is specified, use it. If no password is specified, consider the use fo an input mask on STDOUT. But if the loadparm context contains one prefer it over the input. ----------------------------------------------------------------------- Summary of changes: source4/auth/credentials/credentials.c | 5 +++++ source4/scripting/python/samba/getopt.py | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c index 549c269..959068c 100644 --- a/source4/auth/credentials/credentials.c +++ b/source4/auth/credentials/credentials.c @@ -68,6 +68,11 @@ _PUBLIC_ struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx) cred->nt_hash = NULL; + cred->lm_response.data = NULL; + cred->lm_response.length = 0; + cred->nt_response.data = NULL; + cred->nt_response.length = 0; + cred->ccache = NULL; cred->client_gss_creds = NULL; cred->keytab = NULL; diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py index a62bd5a..ba7a9eb 100644 --- a/source4/scripting/python/samba/getopt.py +++ b/source4/scripting/python/samba/getopt.py @@ -66,7 +66,7 @@ class VersionOptions(optparse.OptionGroup): class CredentialsOptions(optparse.OptionGroup): """Command line options for specifying credentials.""" def __init__(self, parser): - self.no_pass = False + self.no_pass = True optparse.OptionGroup.__init__(self, parser, "Credentials Options") self.add_option("--simple-bind-dn", metavar="DN", action="callback", callback=self._set_simple_bind_dn, type=str, @@ -94,6 +94,7 @@ class CredentialsOptions(optparse.OptionGroup): def _set_password(self, option, opt_str, arg, parser): self.creds.set_password(arg) + self.no_pass = False def _set_kerberos(self, option, opt_str, arg, parser): if bool(arg) or arg.lower() == "yes": @@ -111,7 +112,7 @@ class CredentialsOptions(optparse.OptionGroup): :return: Credentials object """ self.creds.guess(lp) - if not self.no_pass: + if self.no_pass: self.creds.set_cmdline_callbacks() return self.creds @@ -119,7 +120,7 @@ class CredentialsOptionsDouble(CredentialsOptions): """Command line options for specifying credentials of two servers.""" def __init__(self, parser): CredentialsOptions.__init__(self, parser) - self.no_pass2 = False + self.no_pass2 = True self.add_option("--simple-bind-dn2", metavar="DN2", action="callback", callback=self._set_simple_bind_dn2, type=str, help="DN to use for a simple bind") @@ -146,6 +147,7 @@ class CredentialsOptionsDouble(CredentialsOptions): def _set_password2(self, option, opt_str, arg, parser): self.creds2.set_password(arg) + self.no_pass2 = False def _set_kerberos2(self, option, opt_str, arg, parser): if bool(arg) or arg.lower() == "yes": @@ -163,6 +165,6 @@ class CredentialsOptionsDouble(CredentialsOptions): :return: Credentials object """ self.creds2.guess(lp) - if not self.no_pass2: + if self.no_pass2: self.creds2.set_cmdline_callbacks() return self.creds2 -- Samba Shared Repository