All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc
@ 2021-09-09  8:12 Markus Armbruster
  2021-09-09  8:12 ` [PATCH 1/2] hmp: Unbreak "change vnc" Markus Armbruster
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Markus Armbruster @ 2021-09-09  8:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, dgilbert, kraxel

If you'd rather delete "change vnc", go ahead and post a patch.

Markus Armbruster (2):
  hmp: Unbreak "change vnc"
  hmp: Drop a bogus sentence from set_password's documentation

 monitor/hmp-cmds.c |  2 +-
 hmp-commands.hx    | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] hmp: Unbreak "change vnc"
  2021-09-09  8:12 [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Markus Armbruster
@ 2021-09-09  8:12 ` Markus Armbruster
  2021-09-09  8:42   ` Daniel P. Berrangé
  2021-09-23 15:03   ` Laurent Vivier
  2021-09-09  8:12 ` [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation Markus Armbruster
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Markus Armbruster @ 2021-09-09  8:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, qemu-stable, dgilbert, kraxel

HMP command "change vnc" can take the password as argument, or prompt
for it:

    (qemu) change vnc password 123
    (qemu) change vnc password
    Password: ***
    (qemu)

This regressed in commit cfb5387a1d "hmp: remove "change vnc TARGET"
command", v6.0.0.

    (qemu) change vnc passwd 123
    Password: ***
    (qemu) change vnc passwd
    (qemu)

The latter passes NULL to qmp_change_vnc_password(), which is a no-no.
Looks like it puts the display into "password required, but none set"
state.

The logic error is easy to miss in review, but testing should've
caught it.

Fix the obvious way.

Fixes: cfb5387a1de2acda23fb5c97d2378b9e7ddf8025
Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.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 e00255f7ee..a7e197a90b 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1496,7 +1496,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.31.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation
  2021-09-09  8:12 [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Markus Armbruster
  2021-09-09  8:12 ` [PATCH 1/2] hmp: Unbreak "change vnc" Markus Armbruster
@ 2021-09-09  8:12 ` Markus Armbruster
  2021-09-09  8:42   ` Daniel P. Berrangé
  2021-09-23 15:04   ` Laurent Vivier
  2021-09-10  5:29 ` [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Gerd Hoffmann
  2021-09-17 12:13 ` Markus Armbruster
  3 siblings, 2 replies; 9+ messages in thread
From: Markus Armbruster @ 2021-09-09  8:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, dgilbert, kraxel

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hmp-commands.hx | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/hmp-commands.hx b/hmp-commands.hx
index 8e45bce2cd..cf723c69ac 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1522,12 +1522,11 @@ ERST
 
 SRST
 ``set_password [ vnc | spice ] password [ action-if-connected ]``
-  Change spice/vnc password.  Use zero to make the password stay valid
-  forever.  *action-if-connected* specifies what should happen in
-  case a connection is established: *fail* makes the password change
-  fail.  *disconnect* changes the password and disconnects the
-  client.  *keep* changes the password and keeps the connection up.
-  *keep* is the default.
+  Change spice/vnc password.  *action-if-connected* specifies what
+  should happen in case a connection is established: *fail* makes the
+  password change fail.  *disconnect* changes the password and
+  disconnects the client.  *keep* changes the password and keeps the
+  connection up.  *keep* is the default.
 ERST
 
     {
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation
  2021-09-09  8:12 ` [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation Markus Armbruster
@ 2021-09-09  8:42   ` Daniel P. Berrangé
  2021-09-23 15:04   ` Laurent Vivier
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel P. Berrangé @ 2021-09-09  8:42 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: pbonzini, kraxel, qemu-devel, dgilbert

On Thu, Sep 09, 2021 at 10:12:19AM +0200, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hmp-commands.hx | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] hmp: Unbreak "change vnc"
  2021-09-09  8:12 ` [PATCH 1/2] hmp: Unbreak "change vnc" Markus Armbruster
@ 2021-09-09  8:42   ` Daniel P. Berrangé
  2021-09-23 15:03   ` Laurent Vivier
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel P. Berrangé @ 2021-09-09  8:42 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: pbonzini, kraxel, qemu-devel, dgilbert, qemu-stable

On Thu, Sep 09, 2021 at 10:12:18AM +0200, Markus Armbruster wrote:
> HMP command "change vnc" can take the password as argument, or prompt
> for it:
> 
>     (qemu) change vnc password 123
>     (qemu) change vnc password
>     Password: ***
>     (qemu)
> 
> This regressed in commit cfb5387a1d "hmp: remove "change vnc TARGET"
> command", v6.0.0.
> 
>     (qemu) change vnc passwd 123
>     Password: ***
>     (qemu) change vnc passwd
>     (qemu)
> 
> The latter passes NULL to qmp_change_vnc_password(), which is a no-no.
> Looks like it puts the display into "password required, but none set"
> state.
> 
> The logic error is easy to miss in review, but testing should've
> caught it.
> 
> Fix the obvious way.
> 
> Fixes: cfb5387a1de2acda23fb5c97d2378b9e7ddf8025
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  monitor/hmp-cmds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc
  2021-09-09  8:12 [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Markus Armbruster
  2021-09-09  8:12 ` [PATCH 1/2] hmp: Unbreak "change vnc" Markus Armbruster
  2021-09-09  8:12 ` [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation Markus Armbruster
@ 2021-09-10  5:29 ` Gerd Hoffmann
  2021-09-17 12:13 ` Markus Armbruster
  3 siblings, 0 replies; 9+ messages in thread
From: Gerd Hoffmann @ 2021-09-10  5:29 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: pbonzini, qemu-devel, dgilbert

On Thu, Sep 09, 2021 at 10:12:17AM +0200, Markus Armbruster wrote:
> If you'd rather delete "change vnc", go ahead and post a patch.
> 
> Markus Armbruster (2):
>   hmp: Unbreak "change vnc"
>   hmp: Drop a bogus sentence from set_password's documentation

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc
  2021-09-09  8:12 [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Markus Armbruster
                   ` (2 preceding siblings ...)
  2021-09-10  5:29 ` [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Gerd Hoffmann
@ 2021-09-17 12:13 ` Markus Armbruster
  3 siblings, 0 replies; 9+ messages in thread
From: Markus Armbruster @ 2021-09-17 12:13 UTC (permalink / raw)
  To: qemu-trivial; +Cc: pbonzini, kraxel, qemu-devel, dgilbert

Routing to qemu-trivial.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] hmp: Unbreak "change vnc"
  2021-09-09  8:12 ` [PATCH 1/2] hmp: Unbreak "change vnc" Markus Armbruster
  2021-09-09  8:42   ` Daniel P. Berrangé
@ 2021-09-23 15:03   ` Laurent Vivier
  1 sibling, 0 replies; 9+ messages in thread
From: Laurent Vivier @ 2021-09-23 15:03 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: qemu-trivial, pbonzini, kraxel, qemu-stable, dgilbert

Le 09/09/2021 à 10:12, Markus Armbruster a écrit :
> HMP command "change vnc" can take the password as argument, or prompt
> for it:
> 
>     (qemu) change vnc password 123
>     (qemu) change vnc password
>     Password: ***
>     (qemu)
> 
> This regressed in commit cfb5387a1d "hmp: remove "change vnc TARGET"
> command", v6.0.0.
> 
>     (qemu) change vnc passwd 123
>     Password: ***
>     (qemu) change vnc passwd
>     (qemu)
> 
> The latter passes NULL to qmp_change_vnc_password(), which is a no-no.
> Looks like it puts the display into "password required, but none set"
> state.
> 
> The logic error is easy to miss in review, but testing should've
> caught it.
> 
> Fix the obvious way.
> 
> Fixes: cfb5387a1de2acda23fb5c97d2378b9e7ddf8025
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Markus Armbruster <armbru@redhat.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 e00255f7ee..a7e197a90b 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -1496,7 +1496,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;
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation
  2021-09-09  8:12 ` [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation Markus Armbruster
  2021-09-09  8:42   ` Daniel P. Berrangé
@ 2021-09-23 15:04   ` Laurent Vivier
  1 sibling, 0 replies; 9+ messages in thread
From: Laurent Vivier @ 2021-09-23 15:04 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: qemu-trivial, pbonzini, dgilbert, kraxel

Le 09/09/2021 à 10:12, Markus Armbruster a écrit :
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hmp-commands.hx | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index 8e45bce2cd..cf723c69ac 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1522,12 +1522,11 @@ ERST
>  
>  SRST
>  ``set_password [ vnc | spice ] password [ action-if-connected ]``
> -  Change spice/vnc password.  Use zero to make the password stay valid
> -  forever.  *action-if-connected* specifies what should happen in
> -  case a connection is established: *fail* makes the password change
> -  fail.  *disconnect* changes the password and disconnects the
> -  client.  *keep* changes the password and keeps the connection up.
> -  *keep* is the default.
> +  Change spice/vnc password.  *action-if-connected* specifies what
> +  should happen in case a connection is established: *fail* makes the
> +  password change fail.  *disconnect* changes the password and
> +  disconnects the client.  *keep* changes the password and keeps the
> +  connection up.  *keep* is the default.
>  ERST
>  
>      {
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-23 15:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09  8:12 [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Markus Armbruster
2021-09-09  8:12 ` [PATCH 1/2] hmp: Unbreak "change vnc" Markus Armbruster
2021-09-09  8:42   ` Daniel P. Berrangé
2021-09-23 15:03   ` Laurent Vivier
2021-09-09  8:12 ` [PATCH 2/2] hmp: Drop a bogus sentence from set_password's documentation Markus Armbruster
2021-09-09  8:42   ` Daniel P. Berrangé
2021-09-23 15:04   ` Laurent Vivier
2021-09-10  5:29 ` [PATCH 0/2] hmp: Unbreak "change vnc", tidy up set_password's doc Gerd Hoffmann
2021-09-17 12:13 ` Markus Armbruster

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.