aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-08-25 01:37:05 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-08-25 01:37:05 +0000
commit7084851534c834f00652f90a9da5e4032bd22130 (patch)
tree5ec8302aadbaf519b113c8e3c5ca8d015033db57 /monitor.c
parente25a5822ca2dfd229471cc5d02458956b1bf0fa8 (diff)
VNC password authentication, by Daniel P. Berrange.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3135 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index 65668fda0f..3b9408b557 100644
--- a/monitor.c
+++ b/monitor.c
@@ -403,8 +403,17 @@ static void do_change_block(const char *device, const char *filename)
static void do_change_vnc(const char *target)
{
- if (vnc_display_open(NULL, target) < 0)
- term_printf("could not start VNC server on %s\n", target);
+ if (strcmp(target, "passwd") == 0 ||
+ strcmp(target, "password") == 0) {
+ char password[9];
+ monitor_readline("Password: ", 1, password, sizeof(password)-1);
+ password[sizeof(password)-1] = '\0';
+ if (vnc_display_password(NULL, password) < 0)
+ term_printf("could not set VNC server password\n");
+ } else {
+ if (vnc_display_open(NULL, target) < 0)
+ term_printf("could not start VNC server on %s\n", target);
+ }
}
static void do_change(const char *device, const char *target)