mod_client_management: Fix error when last password change is unknown (or never)
Fixes attempt to compare nil with number here, due to
last_password_change being nil
--- a/mod_client_management/mod_client_management.lua Tue Apr 25 19:50:27 2023 +0200
+++ b/mod_client_management/mod_client_management.lua Tue Apr 25 22:06:08 2023 +0200
@@ -206,7 +206,7 @@
-- Client has access if any password-based SASL mechanisms have been used since last password change
for mech, mech_last_used in pairs(client.mechanisms) do
- if is_password_mechanism(mech) and mech_last_used >= last_password_change then
+ if is_password_mechanism(mech) and (not last_password_change or mech_last_used >= last_password_change) then
status.password = mech_last_used;
end
end