mod_auth_smb.c

Luke Kenneth Casson Leighton lkcl at switchboard.net
Tue Mar 17 20:14:05 GMT 1998


On Tue, 17 Mar 1998, Jason Wright wrote:

> > > Apache has all kindsa memory functions, but for the most part you can
> > > ignore them.  My module uses their string allocation stuff and a little
> > > more, but the smblib code is largely unmodified (except that I found a bug
> > > or two in it ;), and it uses standard malloc.  The nice thing about apache
> > > is that you can force it to kill the child processes after handling so
> > > many requests (therefore malloc'd memory will get freed).
> > 
> > ok...
> > 
> > so does the code have to be re-entrant?
> > 
> > can i allocate myself a single static smb client connection structure, or
> > will i have to do one of these on a per-authentication basis?
> > 
> When apache starts up, it forks a set of child processes that perform the
> actual work.  Authentication runs in the process space of each one of
> these, so it need not be reentrant (it doesn't have to be thread safe).

ah, soo...
 
> Now, it may come to pass that the request will have to be interrupted.  In
> that case, you deallocate all that you can and bzero() any passwords you
> may have running around for safety.  A single static smb authentication
> block will do, but you have to make sure that you reinitialize it upon
> entry.

yes, i will be doing that.  and i will blatantly be copying your code.  if
you bzero'd the password memory, then so will i :-)
 
> I'm not an expert in apache,

neither am i.

> and certainly not an expert in smb authentication,

don't worry: i've created a single-call library function to do an NT
Domain "Login".

> so take this with a lot of salt.

pinch, teaspoon or cellar?

luke



More information about the samba-technical mailing list