[PATCH] Add LoadParm optional parameter for Py_Credentials class constructor

Andrew Bartlett abartlet at samba.org
Thu Jan 27 01:09:39 MST 2011


On Wed, 2011-01-26 at 22:04 +0200, Kamen Mazdrashki wrote:
> Hi Jelmer,
> 
> 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)

This looks good to me.  Perhaps just put the segfault test at the end of
the patch stream?  

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.



More information about the samba-technical mailing list