jason at thought.net
Tue Mar 17 19:23:44 GMT 1998
> > 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).
> 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).
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
I'm not an expert in apache, and certainly not an expert in smb
authentication, so take this with a lot of salt.
More information about the samba-technical