Code duplication is bad :/

simo idra at
Tue May 29 12:10:23 GMT 2007

On Tue, 2007-05-29 at 07:44 +0200, Volker Lendecke wrote:
> On Mon, May 28, 2007 at 08:35:38PM -0400, simo wrote:
> > I just found that we open winbindd_idmap.tdb independently in
> > tdbsam_new_rid() in pdb_tdb.c
> > With the new idmap code which can have different providers for the
> > allocation backend this is probably wrong.
> > 
> > I would like to change it to ask winbindd for a RID.
> > Is there a reason why this was not done before and instead we were
> > opening the file directly and fiddling with another subsystem data?
> Why would winbind have to allocate a RID? This is a generic
> task of the SAM, and if I'm right the SAM is inside smbd.
> winbind is there to allocate UID/GIDs. I had gone through
> some pain in the past to separate this cleanly.

The problem is the use of winbindd_idmap.tdb from smbd.
If we change something in the future we may forget again there is
pdb_tdb.c that expects something there.You should have used passdb.tdb
By moving everything to a common function at least we keep all access to
the same tdb in one place so future changes will less likely break


Simo Sorce
Samba Team GPL Compliance Officer
email: idra at

More information about the samba-technical mailing list