Skip to contentSkip to conversation

vnc: Clarify documentation of QMP command change

PATCH In review Markus Armbruster 4 participants 7 messages Jul 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vnc: Clarify documentation of QMP command change

QMP command

    { "execute": "change",
      "arguments": { "device": "vnc", "target": "password", "arg": PWD } }

behaves just like

    { "execute": "change-vnc-password",
      "arguments": { "password", "arg": PWD } }

Their documentation differs, however. According to change-vnc-password's documentation, "an empty password [...] will set the password to the empty string", while change's documentation claims "no future logins will be allowed". The former is actually correct. Replace the incorrect claim by a reference to change-vnc-password.

---
 qapi-schema.json | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
qapi-schema.json +1 -2
index 8b015be..58d3a02 100644
@@ -3011,8 +3011,7 @@
 # @arg:    If @device is a block device, then this is an optional format to open
 #          the device with.
 #          If @device is 'vnc' and @target is 'password', this is the new VNC
-#          password to set.  If this argument is an empty string, then no future
-#          logins will be allowed.
+#          password to set.  See change-vnc-password for additional notes.
 #
 # Returns: Nothing on success.
 #          If @device is not a valid block device, DeviceNotFound
Signature · 1 line
2.7.5
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 10 lines · Markus Armbruster

QMP command

    { "execute": "change",
      "arguments": { "device": "vnc", "target": "password", "arg": PWD } }

behaves just like

    { "execute": "change-vnc-password",
      "arguments": { "password", "arg": PWD } }
Quoted 7 lines

Their documentation differs, however. According to change-vnc-password's documentation, "an empty password [...] will set the password to the empty string", while change's documentation claims "no future logins will be allowed". The former is actually correct. Replace the incorrect claim by a reference to change-vnc-password.

The password would have to be NULL to disallow further login, is that what your other series will allow to do?

Quoted 22 lines
---
 qapi-schema.json | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
qapi-schema.json +1 -3
index 8b015be..58d3a02 100644
@@ -3011,8 +3011,7 @@
 # @arg:    If @device is a block device, then this is an optional format to open
 #          the device with.
 #          If @device is 'vnc' and @target is 'password', this is the new VNC
-#          password to set.  If this argument is an empty string, then no future
-#          logins will be allowed.
+#          password to set.  See change-vnc-password for additional notes.
 #
 # Returns: Nothing on success.
 #          If @device is not a valid block device, DeviceNotFound
--

2.7.5

Signature · 1 line
Marc-André Lureau
#2 lore raw
Quoted 19 lines · Marc-André Lureau

Hi

Quoted 16 lines · Markus Armbruster

QMP command

    { "execute": "change",
      "arguments": { "device": "vnc", "target": "password", "arg": PWD } }

behaves just like

    { "execute": "change-vnc-password",
      "arguments": { "password", "arg": PWD } }

Their documentation differs, however. According to change-vnc-password's documentation, "an empty password [...] will set the password to the empty string", while change's documentation claims "no future logins will be allowed". The former is actually correct. Replace the incorrect claim by a reference to change-vnc-password.

Quoted 7 lines
Quoted 1 line

The password would have to be NULL to disallow further login, is that what your other series will allow to do?

I guess it could be applied to change-vnc-password that way.

#3 lore raw
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Marc-André Lureau

Hi

Quoted 2 lines · Markus Armbruster

QMP command

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
    { "execute": "change",
      "arguments": { "device": "vnc", "target": "password", "arg": PWD } }

behaves just like

    { "execute": "change-vnc-password",
      "arguments": { "password", "arg": PWD } }

This should be

          "arguments": { "password": PWD } }
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

Their documentation differs, however. According to change-vnc-password's documentation, "an empty password [...] will set the password to the empty string", while change's documentation claims "no future logins will be allowed". The former is actually correct. Replace the incorrect claim by a reference to change-vnc-password.

Quoted 7 lines
Quoted 5 lines

The password would have to be NULL to disallow further login, is that what your other series will allow to do?

I guess it could be applied to change-vnc-password that way.

However, making @password optional would be even simpler. Absent @password = no password feels natural to me.

#4 lore raw
In reply to Markus Armbruster
Quoted 23 lines · Markus Armbruster
Quoted 21 lines · Marc-André Lureau

Hi

Quoted 17 lines · Markus Armbruster

QMP command

    { "execute": "change",
      "arguments": { "device": "vnc", "target": "password", "arg": PWD } }

behaves just like

    { "execute": "change-vnc-password",
      "arguments": { "password", "arg": PWD } }

Their documentation differs, however. According to change-vnc-password's documentation, "an empty password [...] will set the password to the empty string", while change's documentation claims "no future logins will be allowed". The former is actually correct. Replace the incorrect claim by a reference to change-vnc-password.

Quoted 7 lines
Quoted 5 lines

The password would have to be NULL to disallow further login, is that what your other series will allow to do?

I guess it could be applied to change-vnc-password that way.

Ideally, 'change' will be deprecated (and certainly we shouldn't add anything further to it), but yes, 'change-vnc-password' could be enhanced in 2.11 to use the StrOrNull alternate to use null as the request for no password (since the empty string "" _is_ hashable as a password, whether or not we currently allow it to be one).

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#5 lore raw
In reply to Marc-André Lureau

Hi,

Quoted 2 lines

The password would have to be NULL to disallow further login, is that what your other series will allow to do?

Disallow logins can be done using "expire-password vnc now".

I think having multiple ways to archive the same thing is a bad idea from a security point of view, so I'd suggest to not touch the behavior of the various set-password command variants.

cheers,
Gerd

#6 lore raw
Quoted 10 lines · Gerd Hoffmann

Hi,

Quoted 2 lines

The password would have to be NULL to disallow further login, is that what your other series will allow to do?

Disallow logins can be done using "expire-password vnc now".

I think having multiple ways to archive the same thing is a bad idea from a security point of view, so I'd suggest to not touch the behavior of the various set-password command variants.

Makes sense.