On Mon, 2008-10-20 at 14:07 -0500, Volker Lendecke wrote: > The branch, master has been updated > via bc9bbda8b390a221d7b88fd6eb1b54efc8c91c6b (commit) > from f3843e330f312b72a24563417309159b0d99dc50 (commit) > > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master > > > - Log ----------------------------------------------------------------- > commit bc9bbda8b390a221d7b88fd6eb1b54efc8c91c6b > Author: Volker Lendecke <[EMAIL PROTECTED]> > Date: Mon Oct 20 18:25:13 2008 +0200 > > Fix a valgrind error in idmap_ad_sids_to_unixids() > > We need to initialize all mappings in case we don't find anything. > > Simo, please check! > > Volker > > ----------------------------------------------------------------------- > > Summary of changes: > source3/winbindd/idmap_ad.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > > Changeset truncated at 500 lines: > > diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c > index 8144d87..60a2d86 100644 > --- a/source3/winbindd/idmap_ad.c > +++ b/source3/winbindd/idmap_ad.c > @@ -517,6 +517,8 @@ again: > bidx = idx; > for (i = 0; (i < IDMAP_AD_MAX_IDS) && ids[idx]; i++, idx++) { > > + ids[idx]->status = ID_UNKNOWN; > + > sidstr = sid_binstring(ids[idx]->sid); > filter = talloc_asprintf_append_buffer(filter, > "(objectSid=%s)", sidstr); >
I am almost sure the old code did initialize the status before calling the backends. The reason was that if the mapping was expired and the backend failed for some reason you would get back again the status as expired. This way it was possible to re-use a valid mapping until the backend came back online. I think the best fix is to initialize it before actually calling backend specific code. Also we should probably check code paths when an expired mapping is found and the backend is not able to work (either beciause offline or because of other problems). When the backend cannot do a proper check an expired mapping should be preserved. Simo. -- Simo Sorce Samba Team GPL Compliance Officer <[EMAIL PROTECTED]> Senior Software Engineer at Red Hat Inc. <[EMAIL PROTECTED]>
