[PATCH] passdb: Cache output from pdb_[ug]id_to_sid

Andrew Bartlett abartlet at samba.org
Tue Jan 6 18:43:09 MST 2015


On Tue, 2015-01-06 at 08:29 -0800, Jeremy Allison wrote:
> On Tue, Jan 06, 2015 at 08:21:57AM +0100, Volker Lendecke wrote:
> > On Mon, Jan 05, 2015 at 04:12:08PM -0800, Jeremy Allison wrote:
> > > So Volker's code should only be catching the
> > > case where pdb_id_to_sid() returns false,
> > > so will only be adding the cache entry
> > > in the:
> > > 
> > >         /* This is an unmapped user */
> > > 
> > >         uid_to_unix_users_sid(uid, psid);
> > > 
> > > case inside legacy_uid_to_sid(). So in
> > > this case we *know* the id.type is ID_TYPE_UID
> > > (and is ID_TYPE_GID in the legacy_gid_to_sid()
> > > case).
> > > 
> > > Volker - how about moving the additional
> > > idmap_cache_set_sid2unixid() calls to the
> > > "This is an unmapped user" or "This is an unmapped group"
> > > cases ?
> > > 
> > > Does that fix the customer lookup problem ?
> > 
> > Yes, it's the unmapped id's that hit the customer pretty
> > hard. So we should move the new code to above the "done"?
> 
> OK - LGTM, I'm happy to push this.
> 
> Andrew, I'll give you a day or so to comment
> as I know you're in LinuxConf.au but this new
> code is only being invoked when pdb_id_to_sid() returns false
> (otherwise it would already have been cached)
> and the unmapped global_sid_Unix_Users or
> global_sid_Unix_Groups is being returned,
> so I'm pretty confident this doesn't hit the
> case you're worried about.

Yes, this addresses my concerns. 

Thanks!

Andrew Bartlett

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba






More information about the samba-technical mailing list