aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorMichal Srb <michalsrb@gmail.com>2014-11-10 09:15:41 +0200
committerMichal Srb <michalsrb@gmail.com>2014-11-10 17:23:42 +0200
commit8d1ee00bea125fa5f3e6ad7cf816e80890fb17d3 (patch)
tree6c56fa447a1485e82cfe965a6a7af622d7172cc1 /common
parent39847138172032bd821dfd6466ee2c04bedbadf7 (diff)
downloadtigervnc-8d1ee00bea125fa5f3e6ad7cf816e80890fb17d3.tar.gz
tigervnc-8d1ee00bea125fa5f3e6ad7cf816e80890fb17d3.zip
Allow SSecurity to specify AccessRights for SConnection.
SConnection has AccessRights property that specifies what connected client can do. Set this property to value given by SSecurity after successful authentication. This way individual SSecurity subclasses can accept clients but restrict their access.
Diffstat (limited to 'common')
-rw-r--r--common/rfb/SConnection.cxx2
-rw-r--r--common/rfb/SConnection.h1
-rw-r--r--common/rfb/SSecurity.h5
-rw-r--r--common/rfb/Security.h1
-rw-r--r--common/rfb/SecurityServer.h3
5 files changed, 7 insertions, 5 deletions
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index eeaeafe4..4bf0f932 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -28,6 +28,7 @@
#include <rfb/ServerCore.h>
#include <rfb/encodings.h>
#include <rfb/EncodeManager.h>
+#include <rfb/SSecurity.h>
#include <rfb/LogWriter.h>
@@ -223,6 +224,7 @@ void SConnection::processSecurityMsg()
if (done) {
state_ = RFBSTATE_QUERYING;
queryConnection(ssecurity->getUserName());
+ setAccessRights(ssecurity->getAccessRights());
}
} catch (AuthFailureException& e) {
vlog.error("AuthFailureException: %s", e.str());
diff --git a/common/rfb/SConnection.h b/common/rfb/SConnection.h
index 7718f4c1..f7124173 100644
--- a/common/rfb/SConnection.h
+++ b/common/rfb/SConnection.h
@@ -28,7 +28,6 @@
#include <rdr/OutStream.h>
#include <rfb/SMsgHandler.h>
#include <rfb/SecurityServer.h>
-#include <rfb/SSecurity.h>
namespace rfb {
diff --git a/common/rfb/SSecurity.h b/common/rfb/SSecurity.h
index afc744e4..6da63c3c 100644
--- a/common/rfb/SSecurity.h
+++ b/common/rfb/SSecurity.h
@@ -44,13 +44,12 @@
#define __RFB_SSECURITY_H__
#include <rdr/types.h>
+#include <rfb/SConnection.h>
#include <rfb/util.h>
#include <list>
namespace rfb {
- class SConnection;
-
class SSecurity {
public:
virtual ~SSecurity() {}
@@ -63,6 +62,8 @@ namespace rfb {
// necessary. Null may be returned to indicate that there is no user name
// for this security type.
virtual const char* getUserName() const = 0;
+
+ virtual SConnection::AccessRights getAccessRights() const { return SConnection::AccessDefault; }
};
}
diff --git a/common/rfb/Security.h b/common/rfb/Security.h
index 196eb429..85bc325a 100644
--- a/common/rfb/Security.h
+++ b/common/rfb/Security.h
@@ -25,7 +25,6 @@
#include <rdr/types.h>
#include <rfb/Configuration.h>
#include <rfb/CSecurity.h>
-#include <rfb/SSecurity.h>
#include <list>
diff --git a/common/rfb/SecurityServer.h b/common/rfb/SecurityServer.h
index 0986619a..019d67fc 100644
--- a/common/rfb/SecurityServer.h
+++ b/common/rfb/SecurityServer.h
@@ -22,9 +22,10 @@
#include <rfb/Configuration.h>
#include <rfb/Security.h>
-#include <rfb/SSecurity.h>
namespace rfb {
+
+ class SSecurity;
class SecurityServer : public Security {
public: