* 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-05 23:18 [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor Nolan
@ 2009-03-06 9:53 ` Daniel P. Berrange
0 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrange @ 2009-03-06 9:53 UTC (permalink / raw)
To: qemu-devel
On Thu, Mar 05, 2009 at 03:18:41PM -0800, Nolan wrote:
> 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.
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
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
^ 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
* 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, 0 replies; 6+ messages in thread
From: Daniel P. Berrange @ 2009-03-09 10:02 UTC (permalink / raw)
To: qemu-devel
On Fri, Mar 06, 2009 at 02:34:18PM -0800, Nolan wrote:
> 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 aim to please :-)
> 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.
This was news to me too! It is probably worth mentioning this explicitly
in the qemu-doc.texi documentation file on the 'change vnc passwd'
command, if you wish to provide a patch to that.
Regards,
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
^ 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* Re: [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, 0 replies; 6+ messages in thread
From: Anthony Liguori @ 2009-03-05 20:28 UTC (permalink / raw)
To: qemu-devel
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)
>
>
>
>
>
>
^ permalink raw reply [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).