diff options
author | Kyle J. McKay <[email protected]> | 2012-02-10 19:13:00 -0800 |
---|---|---|
committer | Christian Beier <[email protected]> | 2012-02-11 13:38:20 +0100 |
commit | 5c57575c357bd1f277303607312266fd2139ad6e (patch) | |
tree | d76de5d76d9adde131489956b0e21d3ad3e22c30 /libvncserver/rfbserver.c | |
parent | 8121e8445d157c4f2e15770a9222ca9948a62e22 (diff) | |
download | libtdevnc-5c57575c357bd1f277303607312266fd2139ad6e.tar.gz libtdevnc-5c57575c357bd1f277303607312266fd2139ad6e.zip |
Support Mac OS X vnc client with no password
Support connections from the Mac OS X built-in VNC client to
LibVNCServers running with no password and advertising a server
version of 3.7 or greater.
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r-- | libvncserver/rfbserver.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index b42a5ea..9be255f 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -593,6 +593,7 @@ rfbProcessClientMessage(rfbClientPtr cl) rfbAuthProcessClientMessage(cl); return; case RFB_INITIALISATION: + case RFB_INITIALISATION_SHARED: rfbProcessClientInitMessage(cl); return; default: @@ -720,13 +721,22 @@ rfbProcessClientInitMessage(rfbClientPtr cl) rfbClientPtr otherCl; rfbExtensionData* extension; - if ((n = rfbReadExact(cl, (char *)&ci,sz_rfbClientInitMsg)) <= 0) { - if (n == 0) - rfbLog("rfbProcessClientInitMessage: client gone\n"); - else - rfbLogPerror("rfbProcessClientInitMessage: read"); - rfbCloseClient(cl); - return; + if (cl->state == RFB_INITIALISATION_SHARED) { + /* In this case behave as though an implicit ClientInit message has + * already been received with a shared-flag of true. */ + ci.shared = 1; + /* Avoid the possibility of exposing the RFB_INITIALISATION_SHARED + * state to calling software. */ + cl->state = RFB_INITIALISATION; + } else { + if ((n = rfbReadExact(cl, (char *)&ci,sz_rfbClientInitMsg)) <= 0) { + if (n == 0) + rfbLog("rfbProcessClientInitMessage: client gone\n"); + else + rfbLogPerror("rfbProcessClientInitMessage: read"); + rfbCloseClient(cl); + return; + } } memset(u.buf,0,sizeof(u.buf)); |