From d96b5349213341f5129d192dd83101582d9d8b50 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Sun, 7 Nov 2021 14:57:34 +0100 Subject: [PATCH] ldap: Improve debug messages --- server/src/infra/ldap_handler.rs | 26 ++++++++++++++++++++++---- server/src/infra/ldap_server.rs | 3 +++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/server/src/infra/ldap_handler.rs b/server/src/infra/ldap_handler.rs index 7dc1215..11adf71 100644 --- a/server/src/infra/ldap_handler.rs +++ b/server/src/infra/ldap_handler.rs @@ -12,7 +12,7 @@ use ldap3_server::proto::{ LdapFilter, LdapOp, LdapPartialAttribute, LdapPasswordModifyRequest, LdapResult, LdapResultCode, LdapSearchRequest, LdapSearchResultEntry, LdapSearchScope, }; -use log::*; +use log::{debug, warn}; use std::convert::TryFrom; fn make_dn_pair(mut iter: I) -> Result<(String, String)> @@ -290,7 +290,7 @@ impl LdapHandler (LdapResultCode, String) { - info!(r#"Received bind request for "{}""#, &request.dn); + debug!(r#"Received bind request for "{}""#, &request.dn); let user_id = match get_user_id_from_distinguished_name( &request.dn, &self.base_dn, @@ -396,10 +396,10 @@ impl LdapHandler dn, Err(_) => { @@ -411,6 +411,10 @@ impl LdapHandler return Ok(false), Some(result) => { + if result.is_empty() { + debug!("No response"); + } for result_op in result.into_iter() { debug!("Replying with LDAP op: {:?}", &result_op); resp.send(LdapMsg {