]> source.dussan.org Git - tigervnc.git/commitdiff
Allow SSecurity to specify AccessRights for SConnection.
authorMichal Srb <michalsrb@gmail.com>
Mon, 10 Nov 2014 07:15:41 +0000 (09:15 +0200)
committerMichal Srb <michalsrb@gmail.com>
Mon, 10 Nov 2014 15:23:42 +0000 (17:23 +0200)
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.

common/rfb/SConnection.cxx
common/rfb/SConnection.h
common/rfb/SSecurity.h
common/rfb/Security.h
common/rfb/SecurityServer.h

index eeaeafe46190be3beb1bd68ed1c2115897784603..4bf0f932e147eaf62944853466c810c97ddea770 100644 (file)
@@ -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());
index 7718f4c171e2e2a259a677603557f1b96b647570..f712417398851708d8c5633290b42f4e505fd3e0 100644 (file)
@@ -28,7 +28,6 @@
 #include <rdr/OutStream.h>
 #include <rfb/SMsgHandler.h>
 #include <rfb/SecurityServer.h>
-#include <rfb/SSecurity.h>
 
 namespace rfb {
 
index afc744e45858749a50066a5e21f06d55344d6b1b..6da63c3ce6a6dd3e5b2024904f4c0d26be26164f 100644 (file)
 #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; }
   };
 
 }
index 196eb4298ce944cc54f59b41ee65df61ef931985..85bc325aea98546a52ceaf8bd6a034cc28a60621 100644 (file)
@@ -25,7 +25,6 @@
 #include <rdr/types.h>
 #include <rfb/Configuration.h>
 #include <rfb/CSecurity.h>
-#include <rfb/SSecurity.h>
 
 #include <list>
 
index 0986619a6c11cd554a29c9759cbb3e141a126230..019d67fce3dbf9e71ae192e9cdbdc0bda788c49c 100644 (file)
 
 #include <rfb/Configuration.h>
 #include <rfb/Security.h>
-#include <rfb/SSecurity.h>
 
 namespace rfb {
+  
+  class SSecurity;
 
   class SecurityServer : public Security {
   public: