[PATCH] Add LoadParm optional parameter for Py_Credentials class constructor

Jelmer Vernooij jelmer at samba.org
Mon Feb 7 10:31:02 MST 2011


Hi Kamen,

On Wed, 2011-01-26 at 22:04 +0200, Kamen Mazdrashki wrote:
> Could you please take a look at following branch:
> http://git.samba.org/?p=kamenim/samba.git;a=shortlog;h=refs/heads/py-review
> 
> It is test to exploit a segfault when Py_Credentials object is used without
> initializing 'domain' and 'workstation' members.
> 
> After a short discussion with abartlet, he prefers the fix to be
> implemented in python layer via adding LoadParm parameter
> for Credentials constructor.
> This way Py_Credentials instances will get the chance to
> call cli_credentials_guess() during construction to try to populate
> cli_credentials structure fields.
> Basically, most common pattern was:
>   creds = Credentials()
>   creds.guess(lp)
> which now turns into just:
>   creds = Credentials(lp)
In particular since we have a global loadparm again, I don't like to
make more things dependent on loadparm. It makes it hard to do proper
testing with alternative settings, and it makes it hard to write
isolated code that's not accidentally influenced by the outside
environment.

Is there any reason we can't simply initialize the domain and
workstation members ?

Cheers,

Jelmer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110207/dbbec256/attachment.pgp>


More information about the samba-technical mailing list