Add AccessSetDesktopSize right.

So clients with limited access rights can not affect it.
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index 4bf0f93..20182a0 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -37,13 +37,14 @@
 static LogWriter vlog("SConnection");
 
 // AccessRights values
-const SConnection::AccessRights SConnection::AccessView       = 0x0001;
-const SConnection::AccessRights SConnection::AccessKeyEvents  = 0x0002;
-const SConnection::AccessRights SConnection::AccessPtrEvents  = 0x0004;
-const SConnection::AccessRights SConnection::AccessCutText    = 0x0008;
-const SConnection::AccessRights SConnection::AccessDefault    = 0x03ff;
-const SConnection::AccessRights SConnection::AccessNoQuery    = 0x0400;
-const SConnection::AccessRights SConnection::AccessFull       = 0xffff;
+const SConnection::AccessRights SConnection::AccessView           = 0x0001;
+const SConnection::AccessRights SConnection::AccessKeyEvents      = 0x0002;
+const SConnection::AccessRights SConnection::AccessPtrEvents      = 0x0004;
+const SConnection::AccessRights SConnection::AccessCutText        = 0x0008;
+const SConnection::AccessRights SConnection::AccessSetDesktopSize = 0x0010;
+const SConnection::AccessRights SConnection::AccessDefault        = 0x03ff;
+const SConnection::AccessRights SConnection::AccessNoQuery        = 0x0400;
+const SConnection::AccessRights SConnection::AccessFull           = 0xffff;
 
 
 SConnection::SConnection(bool reverseConnection_)
diff --git a/common/rfb/SConnection.h b/common/rfb/SConnection.h
index f712417..0379b17 100644
--- a/common/rfb/SConnection.h
+++ b/common/rfb/SConnection.h
@@ -122,13 +122,14 @@
     // is up to the derived class.
 
     typedef rdr::U16 AccessRights;
-    static const AccessRights AccessView;         // View display contents
-    static const AccessRights AccessKeyEvents;    // Send key events
-    static const AccessRights AccessPtrEvents;    // Send pointer events
-    static const AccessRights AccessCutText;      // Send/receive clipboard events
-    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
+    static const AccessRights AccessView;           // View display contents
+    static const AccessRights AccessKeyEvents;      // Send key events
+    static const AccessRights AccessPtrEvents;      // Send pointer events
+    static const AccessRights AccessCutText;        // Send/receive clipboard events
+    static const AccessRights AccessSetDesktopSize; // Change desktop size
+    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
diff --git a/common/rfb/ServerCore.cxx b/common/rfb/ServerCore.cxx
index ae2fd24..b11a352 100644
--- a/common/rfb/ServerCore.cxx
+++ b/common/rfb/ServerCore.cxx
@@ -89,6 +89,10 @@
 ("SendCutText",
  "Send clipboard changes to clients.",
  true);
+rfb::BoolParameter rfb::Server::acceptSetDesktopSize
+("AcceptSetDesktopSize",
+ "Accept set desktop size events from clients.",
+ true);
 rfb::BoolParameter rfb::Server::queryConnect
 ("QueryConnect",
  "Prompt the local user to accept or reject incoming connections.",
diff --git a/common/rfb/ServerCore.h b/common/rfb/ServerCore.h
index e12a8bc..5fc996f 100644
--- a/common/rfb/ServerCore.h
+++ b/common/rfb/ServerCore.h
@@ -46,6 +46,7 @@
     static BoolParameter acceptPointerEvents;
     static BoolParameter acceptCutText;
     static BoolParameter sendCutText;
+    static BoolParameter acceptSetDesktopSize;
     static BoolParameter queryConnect;
 
   };
diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx
index 618048a..274c496 100644
--- a/common/rfb/VNCSConnectionST.cxx
+++ b/common/rfb/VNCSConnectionST.cxx
@@ -584,6 +584,9 @@
 {
   unsigned int result;
 
+  if (!(accessRights & AccessSetDesktopSize)) return;
+  if (!rfb::Server::acceptSetDesktopSize) return;
+
   // Don't bother the desktop with an invalid configuration
   if (!layout.validate(fb_width, fb_height)) {
     writer()->writeExtendedDesktopSize(reasonClient, resultInvalid,