aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Orekhov <vkvo2000@vivaldi.net>2023-03-21 01:46:47 +0300
committerVitaly Orekhov <vkvo2000@vivaldi.net>2023-03-21 01:46:47 +0300
commit6d526798bfee449be69879b881268245327dde70 (patch)
treea3ec708fa82149f36b7706ef6e85d9dad696e810
parent93ddf6892ca32532ff4296e3ac01cd240eb1d56b (diff)
downloadprosody-6d526798bfee449be69879b881268245327dde70.tar.gz
prosody-6d526798bfee449be69879b881268245327dde70.zip
mod_auth_internal_plain: Fix user creation done via mod_admin_shell
Following the new behavior in auth_internal_hashed (c8f59ce7d3cf), the account will be created and disabled, instead of returning an error telling password being nil when calling saslprep(). Note that mod_auth_internal_plain does not have full support for enabled/disabled accounts, but that may be fixed in subsequent commits.
-rw-r--r--plugins/mod_auth_internal_plain.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_auth_internal_plain.lua b/plugins/mod_auth_internal_plain.lua
index 0f65323c..bb3bf7c1 100644
--- a/plugins/mod_auth_internal_plain.lua
+++ b/plugins/mod_auth_internal_plain.lua
@@ -77,11 +77,14 @@ function provider.users()
end
function provider.create_user(username, password)
+ local now = os.time();
+ if password == nil then
+ return accounts:set(username, { created = now, updated = now, disabled = true });
+ end
password = saslprep(password);
if not password then
return nil, "Password fails SASLprep.";
end
- local now = os.time();
return accounts:set(username, {
password = password;
created = now, updated = now;