mod_admin_shell: Only check that local users exist locally
authorKim Alvefur <zash@zash.se>
Mon, 06 Dec 2021 22:23:38 +0100
changeset 12022 c65789f5004e
parent 12021 b3f040e57835
child 12023 a0b6896bb538
mod_admin_shell: Only check that local users exist locally
plugins/mod_admin_shell.lua
--- a/plugins/mod_admin_shell.lua	Thu Apr 15 15:39:35 2021 +0200
+++ b/plugins/mod_admin_shell.lua	Mon Dec 06 22:23:38 2021 +0100
@@ -1335,9 +1335,7 @@
 	if new_roles == nil then host, new_roles = userhost, host; end
 	if not prosody.hosts[host] then
 		return nil, "No such host: "..host;
-	elseif not prosody.hosts[userhost] then
-		return nil, "No such host: "..userhost;
-	elseif not um.user_exists(username, userhost) then
+	elseif prosody.hosts[userhost] and not um.user_exists(username, userhost) then
 		return nil, "No such user";
 	end
 	return um.set_roles(jid, host, coerce_roles(new_roles));