[PATCH] Add LoadParm optional parameter for Py_Credentials class constructor
kamenim at samba.org
Mon Feb 7 12:35:25 MST 2011
On Mon, Feb 7, 2011 at 19:31, Jelmer Vernooij <jelmer at samba.org> wrote:
> Hi Kamen,
> 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
> Is there any reason we can't simply initialize the domain and
> workstation members ?
I can't see any :)
The real problem was that we get segfault if we use py_Credentials()
object with just user/password set.
Please look at the test in the last patch.
IMHO, the real problem is in NTMLSSP layer (I think) as it tries to
marshal Domain and Workstation fields without checking their values.
My first 'fix' was to just initialize cli_credentials structure with empty
string "" for workstation and domain - it seems to me this is a reasonable
default value. Andrew disagreed and that's why the 'fix' was moved up to
the Python's implementation.
If you suggest something else, I will gladly implement it.
My sole desire is to make py_Credentials() object usage clear and easy.
I think currently it is not very clear what one should do to use it.
This leads to a lot of hours wasted for chasing strange segfaults in
unrelated places :)
More information about the samba-technical