diff util/prosodyctl/shell.lua @ 13796:c8e534b4f2e2 13.0

mod_admin_shell, prosodyctl shell: Report command failure when no password entered (fixes #1907)
author Matthew Wild <mwild1@gmail.com>
date Mon, 31 Mar 2025 17:30:50 +0100
parents a28349b8a387
children b1e7d3f571b1
line wrap: on
line diff
--- a/util/prosodyctl/shell.lua	Mon Mar 31 16:25:09 2025 +0100
+++ b/util/prosodyctl/shell.lua	Mon Mar 31 17:30:50 2025 +0100
@@ -134,7 +134,11 @@
 		end
 		if stanza.attr.type == "password" then
 			local password = human_io.read_password();
-			client.send(st.stanza("repl-requested-input", { type = stanza.attr.type, id = stanza.attr.id }):text(password));
+			client.send(st.stanza("repl-requested-input", {
+				type = stanza.attr.type;
+				id = stanza.attr.id;
+				status = password and "submit" or "cancel";
+			}):text(password or ""));
 		else
 			io.stderr:write("Internal error - unexpected input request type "..tostring(stanza.attr.type).."\n");
 			os.exit(1);