From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] ioemu: handle empty vnc passwd Date: Wed, 23 Jan 2008 17:05:54 +0000 Message-ID: <20080123170554.GF5188@implementation.uk.xensource.com> References: <20080123161130.GD5188@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20080123161130.GD5188@implementation.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org ioemu: handle empty vnc passwd Have xenstore_read_vncpasswd return -1 when it is unable to read the passwd from XenStore (and store an empty password). However, don't exit in such case since it may just mean that the use didn't set a passwd. If he really did, xend would have given the passwd flag in the -vnc option, and the empty passwd would make the vnc authentication reject any password anyway. Signed-off-by: Samuel Thibault diff -r 9e92672385a5 tools/ioemu/xenstore.c --- a/tools/ioemu/xenstore.c Wed Jan 23 13:37:03 2008 +0000 +++ b/tools/ioemu/xenstore.c Wed Jan 23 15:53:01 2008 +0000 @@ -518,7 +518,7 @@ int xenstore_read_vncpasswd(int domid, c pwbuf[0] = '\0'; free(uuid); free(path); - return rc; + return -1; } diff -r 9e92672385a5 tools/ioemu/vl.c --- a/tools/ioemu/vl.c Wed Jan 23 13:37:03 2008 +0000 +++ b/tools/ioemu/vl.c Wed Jan 23 15:55:38 2008 +0000 @@ -7756,8 +7756,7 @@ int main(int argc, char **argv) int vnc_display_port; char password[20]; vnc_display_init(ds); - if (xenstore_read_vncpasswd(domid, password, sizeof(password)) < 0) - exit(0); + xenstore_read_vncpasswd(domid, password, sizeof(password)); vnc_display_password(ds, password); if ((vnc_display_port = vnc_display_open(ds, vnc_display, vncunused)) < 0) exit (0);