[PATCH] sam backend parameter

Simo Sorce simo.sorce at xsec.it
Thu Oct 3 10:59:00 GMT 2002

On Thu, 2002-10-03 at 07:22, Jelmer Vernooij wrote:
> On Thu, Oct 03, 2002 at 12:16:53AM +0200, Simo Sorce wrote about 'Re: [PATCH] sam backend parameter':
> > yes a thing I'm not sure has ever been a good idea.
> > to be able to have sam2sam that is really read a backend + store all
> > info into another backend we may take several ways.
> > We never need the 2 backend to be loaded at the same time to do the
> > operation, we may easily read all the accounts chnage the backend and
> > store them into the new one, or simply make custom code to load 2
> > different backends, and use theyr calls.
> > It's easy to have 2 structures calle backend1 and backend2 that holds
> > the functon pointers for 2 backends.
> > Al the context things always seemed to me overcomplicated even for
> > multiple backend code.
> the context stuff has been in passdb since the beginning and is not
> at all used for multiple backends - multiple backends are achieved by
> having multiple 'methods' structs in one context. 
> Next to that, a 'multidb' backend will have to use multiple contexts. 
> We don't want to spoil global name space with the variables
> sam_context contains.
> If we are removing multiple domain support, we could remove
> sam_methods perhaps and move all the functions in sam_methods to 
> sam_context, but sam_context definitely has to stay...
> Jelmer

Ok, I looked back at what do currently context contain in passdb (see
below Appendix A).

It is simply a structure containing the function pointers of the

Of course it need to stay here, it only have a really bad name that make
you think of a totally different thing :-)

I think pdb_functions could have been a better name (no not methods, we
are programmin in C not in Java ;-)


Appendix A:

typedef struct pdb_context 
	struct pdb_methods *pdb_methods;
	struct pdb_methods *pwent_methods;
	/* These functions are wrappers for the functions listed above.
	   They may do extra things like re-reading a SAM_ACCOUNT on update */

	BOOL (*pdb_setsampwent)(struct pdb_context *, BOOL update);
	void (*pdb_endsampwent)(struct pdb_context *);
	BOOL (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user);
	BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct,
const char *username);
	BOOL (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct,
const DOM_SID *sid);
	BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT
	BOOL (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT
	BOOL (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT
	void (*free_fn)(struct pdb_context **);
	TALLOC_CTX *mem_ctx;

Simo Sorce - simo.sorce at xsec.it
Xsec s.r.l.
via Durando 10 Ed. G - 20158 - Milano
tel. +39 02 2399 7130 - fax: +39 02 700 442 399
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20021003/8a0583f2/attachment.bin

More information about the samba-technical mailing list