[SAMBA-TNG] using and createing libsmb and libmsrpc
Cole, Timothy D.
timothy_d_cole at md.northgrum.com
Fri Jan 21 19:20:58 GMT 2000
> -----Original Message-----
> From: Steve Langasek [SMTP:vorlon at netexpress.net]
> Sent: Wednesday, January 19, 2000 20:37
> To: Multiple recipients of list SAMBA-TECHNICAL
> Subject: RE: [SAMBA-TNG] using and createing libsmb and libmsrpc
>
> On Thu, 20 Jan 2000, Luke Kenneth Casson Leighton wrote:
>
> > > > hey, you wannt do a pam_ntdompass, too?
>
> > > Hmm. What do you have in mind?
>
> > ohh, just one function call. see
> > rpcclient/cmd_samr.c:cmd_sam_ntchange_pwd() as an example of what to do.
> > this calls msrpc_sam_ntchange_pwd() which does everything you need.
> about
> > the only thing you _will_ need to do (at the moment), is call the
> > following two functions:
>
> > init_connections();
> > init_policy_hnd(64);
>
> > and that should really be it! in fact, you shouldn't really need to
> call
> > init_connections() because the static variables it uses should be NULL
> > anyway.
>
> Hmm. Alright, I'll take a look at it.
>
> > hey, pams aren't reentrant, are they?
>
> They can be. I've seen some that weren't. I won't guarantee that
> pam_smbpass
> is reentrant, either, since when I started work on it, I didn't know how
> to
> write reentrant code. :) Probably something I should work on cleaning up.
>
Basically don't use global or static local variables, and don't use
any non-reentrant library calls (i.e. any that return a pointer to a static
buffer somewhere that gets filled in by each call), and you should be most
of the way there.
As a bonus, reentrancy gets you most of the way to thread-saftey,
too.
More information about the samba-technical
mailing list