diff options
author | dscho <dscho> | 2005-09-27 15:08:28 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-09-27 15:08:28 +0000 |
commit | 94fcd86cc20dd2ccf7e2299a7dfbcc255c6cc771 (patch) | |
tree | e2507e618ed32eb1a9762aee2d2f2eeb231c9e65 /libvncserver | |
parent | 6bdd2e466a0e6be5245f3c042c2ff230e809fe78 (diff) | |
download | libtdevnc-94fcd86cc20dd2ccf7e2299a7dfbcc255c6cc771.tar.gz libtdevnc-94fcd86cc20dd2ccf7e2299a7dfbcc255c6cc771.zip |
Security is global. This was a misguided attempt to evade a global list.
I eventually saw the light and went with Rohit´s original approach.
Diffstat (limited to 'libvncserver')
-rwxr-xr-x | libvncserver/auth.c | 14 | ||||
-rw-r--r-- | libvncserver/main.c | 1 |
2 files changed, 8 insertions, 7 deletions
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 && size<MAX_SECURITY_TYPES; handler = handler->next) { 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); |