summaryrefslogtreecommitdiffstats
path: root/common/rfb/SConnection.h
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-10-08 15:59:02 +0200
committerPierre Ossman <ossman@cendio.se>2018-10-10 13:15:30 +0200
commit7d64b33b5b96a20216a2e1425ff412e027bbebcd (patch)
treee015b5ac35991b3bc4009a57ccb0b9fd5939a63b /common/rfb/SConnection.h
parent07e44cc508133d874767204d2f96407b0b713bb5 (diff)
downloadtigervnc-7d64b33b5b96a20216a2e1425ff412e027bbebcd.tar.gz
tigervnc-7d64b33b5b96a20216a2e1425ff412e027bbebcd.zip
Move access rights and closing to SConnection object
This makes it generally useful and other code doesn't have to know of the specific sub-class.
Diffstat (limited to 'common/rfb/SConnection.h')
-rw-r--r--common/rfb/SConnection.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/common/rfb/SConnection.h b/common/rfb/SConnection.h
index 47092e35..7148294b 100644
--- a/common/rfb/SConnection.h
+++ b/common/rfb/SConnection.h
@@ -69,6 +69,13 @@ namespace rfb {
void approveConnection(bool accept, const char* reason=0);
+ // Methods to terminate the connection
+
+ // close() shuts down the connection to the client and awaits
+ // cleanup of the SConnection object by the server
+ virtual void close(const char* reason);
+
+
// Overridden from SMsgHandler
virtual void setEncodings(int nEncodings, const rdr::S32* encodings);
@@ -118,8 +125,10 @@ namespace rfb {
virtual void enableContinuousUpdates(bool enable,
int x, int y, int w, int h);
+ // Other methods
+
// setAccessRights() allows a security package to limit the access rights
- // of a VNCSConnectionST to the server. How the access rights are treated
+ // of a SConnection to the server. How the access rights are treated
// is up to the derived class.
typedef rdr::U16 AccessRights;
@@ -132,9 +141,8 @@ namespace rfb {
static const AccessRights AccessDefault; // The default rights, INCLUDING FUTURE ONES
static const AccessRights AccessNoQuery; // Connect without local user accepting
static const AccessRights AccessFull; // All of the available AND FUTURE rights
- virtual void setAccessRights(AccessRights ar) = 0;
-
- // Other methods
+ virtual void setAccessRights(AccessRights ar);
+ virtual bool accessCheck(AccessRights ar) const;
// authenticated() returns true if the client has authenticated
// successfully.
@@ -201,6 +209,7 @@ namespace rfb {
SSecurity* ssecurity;
stateEnum state_;
rdr::S32 preferredEncoding;
+ AccessRights accessRights;
};
}
#endif