From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LfKB8-0008AK-M3 for qemu-devel@nongnu.org; Thu, 05 Mar 2009 15:28:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LfKB5-00089h-Kg for qemu-devel@nongnu.org; Thu, 05 Mar 2009 15:28:25 -0500 Received: from [199.232.76.173] (port=44218 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfKB5-00089c-EQ for qemu-devel@nongnu.org; Thu, 05 Mar 2009 15:28:23 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]:42034) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LfKB5-0001bK-52 for qemu-devel@nongnu.org; Thu, 05 Mar 2009 15:28:23 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e6.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n25KTRbu014291 for ; Thu, 5 Mar 2009 15:29:27 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n25KSLxx176188 for ; Thu, 5 Mar 2009 15:28:21 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n25KSLAv028473 for ; Thu, 5 Mar 2009 15:28:21 -0500 Received: from squirrel.codemonkey.ws (dyn95341160.austin.ibm.com [9.53.41.160]) by d01av04.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n25KSLvr028468 for ; Thu, 5 Mar 2009 15:28:21 -0500 Message-ID: <49B035E4.1010403@us.ibm.com> Date: Thu, 05 Mar 2009 14:28:20 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] support for unsetting the VNC password from the monitor. References: <1236227091.7115.114.camel@voxel> In-Reply-To: <1236227091.7115.114.camel@voxel> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Nolan wrote: > Add monitor support for setting the VNC password to "", disabling VNC. > > The magic sentinel value is "<>" 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'; > + /* "<>" is 9 chars long, so it is not a valid VNC passwd. */ > + if (strcmp(arg, "<>") == 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) > > > > > >