[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] support for unsetting the VNC password from the mon
From: |
Nolan |
Subject: |
[Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor. |
Date: |
Wed, 04 Mar 2009 20:24:51 -0800 |
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)
- [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor.,
Nolan <=