[SSSD] [PATCHES] Better handling of large Active Directory groups

Jakub Hrozek jhrozek at redhat.com
Thu May 10 15:07:43 UTC 2012


On Thu, May 10, 2012 at 07:35:01AM -0400, Stephen Gallagher wrote:
> On Thu, 2012-05-10 at 11:15 +0200, Jakub Hrozek wrote:
> > On Wed, May 09, 2012 at 07:19:29PM -0400, Stephen Gallagher wrote:
> > > On Wed, 2012-05-09 at 22:20 +0200, Jakub Hrozek wrote:
> > > > 
> > > > Nack, the way ldap_get_dn is used leaks memory:
> > > > 
> > > > +                DEBUG(SSSDBG_TRACE_INTERNAL,
> > > > +                      ("Matched objectclass [%s] on DN [%s], will use associated map\n",
> > > > +                       state->maps[mi].map[0].name,
> > > > +                       ldap_get_dn(sh->ldap, msg->msg)));
> > > > 
> > > > The result needs to be freed with ldap_memfree().
> > > > 
> > > > Luckily it's only when SSSDBG_TRACE_INTERNAL is set but we should still
> > > > fix it.
> > > 
> > > I modified the code so we'd look up the DN and talloc_strdup() it onto
> > > the tmp_ctx so it will get automatically freed properly.
> > > 
> > > I thought about limiting this lookup to SSSDBG_TRACE_INTERNAL, but I
> > > reason that if we want to reference the DN in any other log level in the
> > > future, we're going to have to modify this anyway. It's just easier to
> > > always copy it and avoid future heisenbugs.
> > > 
> > > New (and hopefully final) patches attached.
> > 
> > I think you attached the wrong patches...
> 
> Of course I did... I was on a roll yesterday.
> 
> These should be the right ones now.
> 

Ack



More information about the sssd-devel mailing list