util.prosodyctl: Enforce strict JID validation on user creation
authorKim Alvefur <zash@zash.se>
Fri, 01 Nov 2019 22:53:14 +0100
changeset 10371 649acbfbf7fe
parent 10370 5611c939743a
child 10372 76eb79d372de
util.prosodyctl: Enforce strict JID validation on user creation This is where 64ddcbc9a328 should have started. By preventing creation of users with invalid JIDs, it will slowly become safer to enforce strict validation on everything.
util/prosodyctl.lua
--- a/util/prosodyctl.lua	Fri Nov 01 22:08:38 2019 +0100
+++ b/util/prosodyctl.lua	Fri Nov 01 22:53:14 2019 +0100
@@ -134,7 +134,7 @@
 
 -- Server control
 local function adduser(params)
-	local user, host, password = nodeprep(params.user), nameprep(params.host), params.password;
+	local user, host, password = nodeprep(params.user, true), nameprep(params.host), params.password;
 	if not user then
 		return false, "invalid-username";
 	elseif not host then