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

Jan Zelený jzeleny at redhat.com
Mon May 14 08:13:25 UTC 2012


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

After review, I propose this small patch.

Thanks
Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jzeleny-129-minor-memory-leaks.patch
Type: text/x-patch
Size: 1438 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120514/a5590370/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120514/a5590370/attachment.sig>


More information about the sssd-devel mailing list