qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor.
@ 2009-03-05 23:18 Nolan
  2009-03-06  9:53 ` Daniel P. Berrange
  0 siblings, 1 reply; 6+ messages in thread
From: Nolan @ 2009-03-05 23:18 UTC (permalink / raw)
  To: qemu-devel

Anthony wrote:
> Nolan wrote:
> > Add monitor support for setting the VNC password to "", disabling VNC.
> > 
> > The magic sentinel value is "<<unset>>" which is not a valid VNC
> > password by virtue of being 9 characters long.
> 
> That's a little too magical for me. If you want to disable VNC, can't
> you just say change vnc none?

If you start with "-vnc :0,password", you will have no password set
(thus logins are disabled), but qemu is listening on the port (keeping
it occupied).

"vnc change none" will close the socket.  The intent of "change vnc
password <<unset>>" is to leave the socket open, but disallow logins
until the password is reset.  Basically the goal is to provide a way to
get back into state we were in immediately after process start.  This is
currently possible with the interactive "change vnc password" command,
but not possible with the non-interactive variant.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor.
@ 2009-03-06 22:34 Nolan
  2009-03-09 10:02 ` Daniel P. Berrange
  0 siblings, 1 reply; 6+ messages in thread
From: Nolan @ 2009-03-06 22:34 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

Daniel wrote:
> How about just making it parse quotes for the password, so you could
> do 
> 
>   change vnc password ""
> 
> and thus have it set to the empty string. This would also let people
> have passwords with spaces in them

An excellent suggestion.  So excellent in fact, that it already works
with qemu as is.

I rescind my request to apply this patch.  Either quotes being parsed by
the monitor is a relatively new phenomenon, or I spaced pretty badly
when I wrote this last summer.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor.
@ 2009-03-05  4:24 Nolan
  2009-03-05 20:28 ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Nolan @ 2009-03-05  4:24 UTC (permalink / raw)
  To: qemu-devel

Add monitor support for setting the VNC password to "", disabling VNC.

The magic sentinel value is "<<unset>>" which is not a valid VNC password by
virtue of being 9 characters long.

diff --git a/qemu/monitor.c b/qemu/monitor.c
index 1b2adc8..7bbb457 100644
--- a/qemu/monitor.c
+++ b/qemu/monitor.c
@@ -466,8 +466,13 @@ static void do_change_vnc(const char *target, const char *arg)
 	strcmp(target, "password") == 0) {
 	char password[9];
 	if (arg) {
-	    strncpy(password, arg, sizeof(password));
-	    password[sizeof(password) - 1] = '\0';
+            /* "<<unset>>" is 9 chars long, so it is not a valid VNC passwd. */
+            if (strcmp(arg, "<<unset>>") == 0) {
+                password[0] = '\0';
+            } else {
+                strncpy(password, arg, sizeof(password));
+                password[sizeof(password) - 1] = '\0';
+            }
 	} else
 	    monitor_readline("Password: ", 1, password, sizeof(password));
 	if (vnc_display_password(NULL, password) < 0)

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

end of thread, other threads:[~2009-03-09 20:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-05 23:18 [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor Nolan
2009-03-06  9:53 ` Daniel P. Berrange
  -- strict thread matches above, loose matches on Subject: below --
2009-03-06 22:34 Nolan
2009-03-09 10:02 ` Daniel P. Berrange
2009-03-05  4:24 Nolan
2009-03-05 20:28 ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).