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

Jakub Hrozek jhrozek at redhat.com
Thu May 10 09:15:35 UTC 2012


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...

> From f1fe4c13dfa9ad82bec7c3ed6f0651142ef874ab Mon Sep 17 00:00:00 2001
> From: Stephen Gallagher <sgallagh at redhat.com>
> Date: Wed, 9 May 2012 11:07:31 -0400
> 
> Subject: [PATCH 1/3] NSS: Add fallback_homedir option
> This option is similar to override_homedir, except that it will
> take effect only for users that do not have an explicit home
> directory specified in LDAP.
> 
> https://fedorahosted.org/sssd/ticket/1250



More information about the sssd-devel mailing list