Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
d3599be1
Commit
d3599be1
authored
Feb 22, 2006
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add functions to unregister extensions/security types
parent
880035ad
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
134 additions
and
9 deletions
+134
-9
ChangeLog
ChangeLog
+4
-0
auth.c
libvncserver/auth.c
+54
-4
main.c
libvncserver/main.c
+68
-5
rfbtightserver.c
libvncserver/tightvnc-filetransfer/rfbtightserver.c
+5
-0
rfb.h
rfb/rfb.h
+3
-0
No files found.
ChangeLog
View file @
d3599be1
2006-02-22 Rohit Kumar <rokumar@novell.com>
* auth.c, main.c, rfbtightserver.c, rfb.h: add methods to
unregister extensions and security types.
2006-02-20 Karl Runge <runge@karlrunge.com>
2006-02-20 Karl Runge <runge@karlrunge.com>
* main.c, cursor.c, tightvnc-filetransfer: fix some non-gcc
* main.c, cursor.c, tightvnc-filetransfer: fix some non-gcc
compiler warnings.
compiler warnings.
...
...
libvncserver/auth.c
View file @
d3599be1
...
@@ -35,18 +35,68 @@
...
@@ -35,18 +35,68 @@
static
rfbSecurityHandler
*
securityHandlers
=
NULL
;
static
rfbSecurityHandler
*
securityHandlers
=
NULL
;
/*
* This method registers a list of new security types.
* It avoids same security type getting registered multiple times.
* The order is not preserved if multiple security types are
* registered at one-go.
*/
void
void
rfbRegisterSecurityHandler
(
rfbSecurityHandler
*
handler
)
rfbRegisterSecurityHandler
(
rfbSecurityHandler
*
handler
)
{
{
rfbSecurityHandler
*
last
=
handler
;
rfbSecurityHandler
*
head
=
securityHandlers
,
*
next
=
NULL
;
if
(
handler
==
NULL
)
return
;
while
(
last
->
next
)
next
=
handler
->
next
;
last
=
last
->
next
;
last
->
next
=
securityHandlers
;
while
(
head
!=
NULL
)
{
if
(
head
==
handler
)
{
rfbRegisterSecurityHandler
(
next
);
return
;
}
head
=
head
->
next
;
}
handler
->
next
=
securityHandlers
;
securityHandlers
=
handler
;
securityHandlers
=
handler
;
rfbRegisterSecurityHandler
(
next
);
}
}
/*
* This method unregisters a list of security types.
* These security types won't be available for any new
* client connection.
*/
void
rfbUnregisterSecurityHandler
(
rfbSecurityHandler
*
handler
)
{
rfbSecurityHandler
*
cur
=
NULL
,
*
pre
=
NULL
;
if
(
handler
==
NULL
)
return
;
if
(
securityHandlers
==
handler
)
{
securityHandlers
=
securityHandlers
->
next
;
rfbUnregisterSecurityHandler
(
handler
->
next
);
return
;
}
cur
=
pre
=
securityHandlers
;
while
(
cur
)
{
if
(
cur
==
handler
)
{
pre
->
next
=
cur
->
next
;
break
;
}
pre
=
cur
;
cur
=
cur
->
next
;
}
rfbUnregisterSecurityHandler
(
handler
->
next
);
}
/*
/*
* Send the authentication challenge.
* Send the authentication challenge.
...
...
libvncserver/main.c
View file @
d3599be1
...
@@ -59,10 +59,21 @@ char rfbEndianTest = -1;
...
@@ -59,10 +59,21 @@ char rfbEndianTest = -1;
static
rfbProtocolExtension
*
rfbExtensionHead
=
NULL
;
static
rfbProtocolExtension
*
rfbExtensionHead
=
NULL
;
/*
* This method registers a list of new extensions.
* It avoids same extension getting registered multiple times.
* The order is not preserved if multiple extensions are
* registered at one-go.
*/
void
void
rfbRegisterProtocolExtension
(
rfbProtocolExtension
*
extension
)
rfbRegisterProtocolExtension
(
rfbProtocolExtension
*
extension
)
{
{
rfbProtocolExtension
*
last
;
rfbProtocolExtension
*
head
=
rfbExtensionHead
,
*
next
=
NULL
;
if
(
extension
==
NULL
)
return
;
next
=
extension
->
next
;
if
(
!
extMutex_initialized
)
{
if
(
!
extMutex_initialized
)
{
INIT_MUTEX
(
extMutex
);
INIT_MUTEX
(
extMutex
);
...
@@ -70,14 +81,66 @@ rfbRegisterProtocolExtension(rfbProtocolExtension* extension)
...
@@ -70,14 +81,66 @@ rfbRegisterProtocolExtension(rfbProtocolExtension* extension)
}
}
LOCK
(
extMutex
);
LOCK
(
extMutex
);
last
=
extension
;
while
(
last
->
next
)
while
(
head
!=
NULL
)
{
last
=
last
->
next
;
if
(
head
==
extension
)
{
UNLOCK
(
extMutex
);
rfbRegisterProtocolExtension
(
next
);
return
;
}
head
=
head
->
next
;
}
last
->
next
=
rfbExtensionHead
;
extension
->
next
=
rfbExtensionHead
;
rfbExtensionHead
=
extension
;
rfbExtensionHead
=
extension
;
UNLOCK
(
extMutex
);
rfbRegisterProtocolExtension
(
next
);
}
/*
* This method unregisters a list of extensions.
* These extensions won't be available for any new
* client connection.
*/
void
rfbUnregisterProtocolExtension
(
rfbProtocolExtension
*
extension
)
{
rfbProtocolExtension
*
cur
=
NULL
,
*
pre
=
NULL
;
if
(
extension
==
NULL
)
return
;
if
(
!
extMutex_initialized
)
{
INIT_MUTEX
(
extMutex
);
extMutex_initialized
=
1
;
}
LOCK
(
extMutex
);
if
(
rfbExtensionHead
==
extension
)
{
rfbExtensionHead
=
rfbExtensionHead
->
next
;
UNLOCK
(
extMutex
);
rfbUnregisterProtocolExtension
(
extension
->
next
);
return
;
}
cur
=
pre
=
rfbExtensionHead
;
while
(
cur
)
{
if
(
cur
==
extension
)
{
pre
->
next
=
cur
->
next
;
break
;
}
pre
=
cur
;
cur
=
cur
->
next
;
}
UNLOCK
(
extMutex
);
UNLOCK
(
extMutex
);
rfbUnregisterProtocolExtension
(
extension
->
next
);
}
}
rfbProtocolExtension
*
rfbGetExtensionIterator
()
rfbProtocolExtension
*
rfbGetExtensionIterator
()
...
...
libvncserver/tightvnc-filetransfer/rfbtightserver.c
View file @
d3599be1
...
@@ -506,4 +506,9 @@ void rfbRegisterTightVNCFileTransferExtension() {
...
@@ -506,4 +506,9 @@ void rfbRegisterTightVNCFileTransferExtension() {
rfbRegisterSecurityHandler
(
&
tightVncSecurityHandler
);
rfbRegisterSecurityHandler
(
&
tightVncSecurityHandler
);
}
}
void
rfbUnregisterTightVNCFileTransferExtension
()
{
rfbUnregisterProtocolExtension
(
&
tightVncFileTransferExtension
);
rfbUnregisterSecurityHandler
(
&
tightVncSecurityHandler
);
}
rfb/rfb.h
View file @
d3599be1
...
@@ -631,6 +631,7 @@ extern void rfbAuthNewClient(rfbClientPtr cl);
...
@@ -631,6 +631,7 @@ extern void rfbAuthNewClient(rfbClientPtr cl);
extern
void
rfbProcessClientSecurityType
(
rfbClientPtr
cl
);
extern
void
rfbProcessClientSecurityType
(
rfbClientPtr
cl
);
extern
void
rfbAuthProcessClientMessage
(
rfbClientPtr
cl
);
extern
void
rfbAuthProcessClientMessage
(
rfbClientPtr
cl
);
extern
void
rfbRegisterSecurityHandler
(
rfbSecurityHandler
*
handler
);
extern
void
rfbRegisterSecurityHandler
(
rfbSecurityHandler
*
handler
);
extern
void
rfbUnregisterSecurityHandler
(
rfbSecurityHandler
*
handler
);
/* rre.c */
/* rre.c */
...
@@ -792,6 +793,7 @@ void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion);
...
@@ -792,6 +793,7 @@ void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion);
void
rfbDoNothingWithClient
(
rfbClientPtr
cl
);
void
rfbDoNothingWithClient
(
rfbClientPtr
cl
);
enum
rfbNewClientAction
defaultNewClientHook
(
rfbClientPtr
cl
);
enum
rfbNewClientAction
defaultNewClientHook
(
rfbClientPtr
cl
);
void
rfbRegisterProtocolExtension
(
rfbProtocolExtension
*
extension
);
void
rfbRegisterProtocolExtension
(
rfbProtocolExtension
*
extension
);
void
rfbUnregisterProtocolExtension
(
rfbProtocolExtension
*
extension
);
struct
_rfbProtocolExtension
*
rfbGetExtensionIterator
();
struct
_rfbProtocolExtension
*
rfbGetExtensionIterator
();
void
rfbReleaseExtensionIterator
();
void
rfbReleaseExtensionIterator
();
rfbBool
rfbEnableExtension
(
rfbClientPtr
cl
,
rfbProtocolExtension
*
extension
,
rfbBool
rfbEnableExtension
(
rfbClientPtr
cl
,
rfbProtocolExtension
*
extension
,
...
@@ -831,6 +833,7 @@ extern rfbBool rfbIsActive(rfbScreenInfoPtr screenInfo);
...
@@ -831,6 +833,7 @@ extern rfbBool rfbIsActive(rfbScreenInfoPtr screenInfo);
/* TightVNC file transfer extension */
/* TightVNC file transfer extension */
void
rfbRegisterTightVNCFileTransferExtension
();
void
rfbRegisterTightVNCFileTransferExtension
();
void
rfbUnregisterTightVNCFileTransferExtension
();
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment