[PATCH] libwbclient clear pointer on bad read

Matthew Newton mcn4 at leicester.ac.uk
Thu Jan 15 13:08:13 MST 2015


On Thu, Jan 15, 2015 at 09:03:48PM +0100, Volker Lendecke wrote:
> On Thu, Jan 15, 2015 at 05:42:15PM +0000, Matthew Newton wrote:
> > With this patch and FreeRADIUS linked to libwbclient for NTLM
> > authentications from multiple threads, it's looking perfect with
> > no errors any more, which is good.
> 
> This is really great. The patch looks very simple!

I was pleasantly surprised how easy it was TBH.

> Stylistically I'd do it a bit differently though: I'd not at all use
> macros.

Yes, I thought that might be the bit you picked up on :) I'm not
familiar with Samba code, so wasn't sure the way that would suit
you best.

> I'd make it two patches: First convert all access to the global variables
> to a two-step process: First call a function like winbindd_fd_ptr()
> returning an int* and then after that access the fd via that pointer. That
> would be the first patch. Second patch would be to introduce the
> thread-specific piece, just adding a #ifdef HAVE_PTHREAD version of it
> not returning &winbindd_fd but the thread specific space.
> 
> Sounds reasonable?

OK, yes that sounds fine - I'll look at it. That will keep the
code a bit cleaner.

Thanks!

Matthew


-- 
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the samba-technical mailing list