From b36dfa237c0d9ad3a1c9d59790d6aab3b1e2e82d Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 4 May 2011 10:42:39 +0200 Subject: Do not leak LDAP URI with high log level --- src/providers/ldap/sdap_fd_events.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/providers/ldap/sdap_fd_events.c b/src/providers/ldap/sdap_fd_events.c index ebec544f..05ea0b5c 100644 --- a/src/providers/ldap/sdap_fd_events.c +++ b/src/providers/ldap/sdap_fd_events.c @@ -103,8 +103,13 @@ static int sdap_ldap_connect_callback_add(LDAP *ld, Sockbuf *sb, DEBUG(1, ("ber_sockbuf_ctrl failed.\n")); return EINVAL; } - DEBUG(9, ("New LDAP connection to [%s] with fd [%d].\n", - ldap_url_desc2str(srv), ber_fd)); + + if (debug_level >= 7) { + char *uri = ldap_url_desc2str(srv); + DEBUG(7, ("New LDAP connection to [%s] with fd [%d].\n", + uri, ber_fd)); + free(uri); + } fd_event_item = talloc_zero(cb_data, struct fd_event_item); if (fd_event_item == NULL) { -- cgit