Changeset

3565:7344513ee160

mod_auth_ldap: Log any error message from open_simple() when testing password
author Kim Alvefur <zash@zash.se>
date Mon, 29 Apr 2019 00:04:16 +0200
parents 3564:35f1dbc943d8
children 3566:b50be75c8bef
files mod_auth_ldap/mod_auth_ldap.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_ldap/mod_auth_ldap.lua	Wed Apr 24 11:00:17 2019 +0200
+++ b/mod_auth_ldap/mod_auth_ldap.lua	Mon Apr 29 00:04:16 2019 +0200
@@ -109,7 +109,11 @@
 	end
 elseif ldap_mode == "bind" then
 	local function test_password(userdn, password)
-		return not not lualdap.open_simple(ldap_server, userdn, password, ldap_tls);
+		local ok, err = lualdap.open_simple(ldap_server, userdn, password, ldap_tls);
+		if not ok then
+			log("debug", "ldap open_simple error: %s", err);
+		end
+		return not not ok;
 	end
 
 	function provider.test_password(username, password)