Changeset

4830:af6143cf7d22

mod_password_policy: Hard failure on missing/empty passwords
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Dec 2021 14:04:01 +0000
parents 4829:caf7e88dc9e5
children 4831:5a42cb84c8ee
files mod_password_policy/mod_password_policy.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_password_policy/mod_password_policy.lua	Wed Dec 22 14:03:25 2021 +0000
+++ b/mod_password_policy/mod_password_policy.lua	Wed Dec 22 14:04:01 2021 +0000
@@ -20,6 +20,10 @@
 local st = require "util.stanza";
 
 function check_password(password, additional_info)
+	if not password or password == "" then
+		return nil, "No password provided", "no-password";
+	end
+
 	if #password < options.length then
 		return nil, ("Password is too short (minimum %d characters)"):format(options.length), "length";
 	end