]> git.proxmox.com Git - pve-qemu.git/blob - debian/patches/extra/0005-monitor-hmp-correctly-invert-password-argument-detec.patch
update and rebase to QEMU v6.1.0
[pve-qemu.git] / debian / patches / extra / 0005-monitor-hmp-correctly-invert-password-argument-detec.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Stefan Reiter <s.reiter@proxmox.com>
3 Date: Wed, 25 Aug 2021 11:08:41 +0200
4 Subject: [PATCH] monitor/hmp: correctly invert password argument detection
5 again
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Commit cfb5387a1d 'hmp: remove "change vnc TARGET" command' claims to
11 remove the HMP "change vnc" command, but doesn't actually do that.
12 Instead it rewires it to use 'qmp_change_vnc_password', and in the
13 process inverts the argument detection - ignoring the first issue, this
14 inversion is wrong, as this will now ask the user for a password if one
15 is already provided, and simply fail if none is given.
16
17 Fixes: cfb5387a1d ("hmp: remove "change vnc TARGET" command")
18 Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
19 Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
20 ---
21 monitor/hmp-cmds.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24 diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
25 index 047294e1ed..f4ef58d257 100644
26 --- a/monitor/hmp-cmds.c
27 +++ b/monitor/hmp-cmds.c
28 @@ -1549,7 +1549,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
29 }
30 if (strcmp(target, "passwd") == 0 ||
31 strcmp(target, "password") == 0) {
32 - if (arg) {
33 + if (!arg) {
34 MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
35 monitor_read_password(hmp_mon, hmp_change_read_arg, NULL);
36 return;