From 94fcd86cc20dd2ccf7e2299a7dfbcc255c6cc771 Mon Sep 17 00:00:00 2001 From: dscho Date: Tue, 27 Sep 2005 15:08:28 +0000 Subject: =?UTF-8?q?Security=20is=20global.=20This=20was=20a=20misguided=20?= =?UTF-8?q?attempt=20to=20evade=20a=20global=20list.=20I=20eventually=20sa?= =?UTF-8?q?w=20the=20light=20and=20went=20with=20Rohit=B4s=20original=20ap?= =?UTF-8?q?proach.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libvncserver/auth.c | 14 ++++++++------ libvncserver/main.c | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'libvncserver') diff --git a/libvncserver/auth.c b/libvncserver/auth.c index 98dc48e..e8de22f 100755 --- a/libvncserver/auth.c +++ b/libvncserver/auth.c @@ -33,16 +33,18 @@ * Handle security types */ +static rfbSecurityHandler* securityHandlers = NULL; + void -rfbRegisterSecurityHandler(rfbScreenInfoPtr server, rfbSecurityHandler* handler) +rfbRegisterSecurityHandler(rfbSecurityHandler* handler) { rfbSecurityHandler* last = handler; while(last->next) last = last->next; - last->next = server->securityHandlers; - server->securityHandlers = handler; + last->next = securityHandlers; + securityHandlers = handler; } @@ -93,10 +95,10 @@ rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType) handler->type = primaryType; handler->handler = rfbVncAuthSendChallenge; handler->next = NULL; - rfbRegisterSecurityHandler(cl->screen, handler); + rfbRegisterSecurityHandler(handler); } - for (handler = cl->screen->securityHandlers; + for (handler = securityHandlers; handler && sizenext) { buffer[size] = handler->type; size++; @@ -227,7 +229,7 @@ rfbProcessClientSecurityType(rfbClientPtr cl) /* Make sure it was present in the list sent by the server. */ - for (handler = cl->screen->securityHandlers; handler; + for (handler = securityHandlers; handler; handler = handler->next) if (chosenType == handler->type) { handler->handler(cl); diff --git a/libvncserver/main.c b/libvncserver/main.c index 5a3d248..a9161ce 100644 --- a/libvncserver/main.c +++ b/libvncserver/main.c @@ -668,7 +668,6 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv, screen->newClientHook = rfbDefaultNewClientHook; screen->displayHook = NULL; screen->processCustomClientMessage = rfbDefaultProcessCustomClientMessage; - screen->securityHandlers = NULL; /* initialize client list and iterator mutex */ rfbClientListInit(screen); -- cgit v1.2.1