On 07/13/2012 01:17 PM, Adam Tkac wrote:
On Tue, Jul 10, 2012 at 03:15:03PM +0200, Petr Spacek wrote:
Hello,

this patch adds an debug message to ldap_cache_addrdatalist().

It is very useful for persistent search debugging.

Hi,

although idea of the patch is fine, I don't think that statements which allocate
memory should be in the "cleanup" path.

What about this (generally used in BIND):

ldap_cache_getrdatalist() {
...
char namebuf[DNS_NAME_FORMATSIZE];
...
cleanup:
     dns_name_format(name, namebuf, sizeof(namebuf));
     log_debug(20, "%s", namebuf);
}

Or you can put this entire code into "if (isc_log_debuglevel() >= 20)" statement
to save some CPU cycles...

Regards, Adam

It is definitely good idea. I forgot to upper-limit for DNS names.

Revised patch was pushed to master:
https://fedorahosted.org/bind-dyndb-ldap/changeset/3c382dd0296f6fe2931ddb0d18de220e6740011c

Petr^2 Spacek

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to