From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor.
Date: Thu, 05 Mar 2009 14:28:20 -0600 [thread overview]
Message-ID: <49B035E4.1010403@us.ibm.com> (raw)
In-Reply-To: <1236227091.7115.114.camel@voxel>
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?
Regards,
Anthony Liguori
> 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)
>
>
>
>
>
>
next prev parent reply other threads:[~2009-03-05 20:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-05 4:24 [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor Nolan
2009-03-05 20:28 ` Anthony Liguori [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-03-05 23:18 Nolan
2009-03-06 9:53 ` Daniel P. Berrange
2009-03-06 22:34 Nolan
2009-03-09 10:02 ` Daniel P. Berrange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49B035E4.1010403@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).