All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Reiter <s.reiter@proxmox.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>,
	Wolfgang Bumiller <w.bumiller@proxmox.com>,
	Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: qemu-devel@nongnu.org
Subject: [PATCH 1/2] monitor/hmp: correctly invert password argument detection again
Date: Wed, 25 Aug 2021 11:37:00 +0200	[thread overview]
Message-ID: <20210825093701.668122-2-s.reiter@proxmox.com> (raw)
In-Reply-To: <20210825093701.668122-1-s.reiter@proxmox.com>

Commit cfb5387a1d 'hmp: remove "change vnc TARGET" command' claims to
remove the HMP "change vnc" command, but doesn't actually do that.
Instead if rewires it to use 'qmp_change_vnc_password', and in the
process inverts the argument detection - ignoring the first issue, this
inversion is wrong, as this will now ask the user for a password if one
is already provided, and simply fail if none is given.

Fixes: cfb5387a1d ("hmp: remove "change vnc TARGET" command")
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
---
 monitor/hmp-cmds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index f7a211e5a4..31366e6331 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1591,7 +1591,7 @@ void hmp_change(Monitor *mon, const QDict *qdict)
         }
         if (strcmp(target, "passwd") == 0 ||
             strcmp(target, "password") == 0) {
-            if (arg) {
+            if (!arg) {
                 MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common);
                 monitor_read_password(hmp_mon, hmp_change_read_arg, NULL);
                 return;
-- 
2.30.2




  reply	other threads:[~2021-08-25  9:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  9:36 [PATCH 0/2] VNC-related HMP/QMP fixes Stefan Reiter
2021-08-25  9:37 ` Stefan Reiter [this message]
2021-08-25 10:42   ` [PATCH 1/2] monitor/hmp: correctly invert password argument detection again Marc-André Lureau
2021-08-25  9:37 ` [PATCH 2/2] monitor: allow VNC related QMP and HMP commands to take a display ID Stefan Reiter
2021-08-25 10:59   ` Marc-André Lureau
2021-08-25 11:26     ` Stefan Reiter
2021-08-25 19:20       ` Eric Blake
2021-08-25 19:16     ` Eric Blake
2021-08-31 12:20       ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210825093701.668122-2-s.reiter@proxmox.com \
    --to=s.reiter@proxmox.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=t.lamprecht@proxmox.com \
    --cc=w.bumiller@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.