aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb')
-rw-r--r--common/rfb/SConnection.cxx15
-rw-r--r--common/rfb/SConnection.h15
-rw-r--r--common/rfb/ServerCore.cxx4
-rw-r--r--common/rfb/ServerCore.h1
-rw-r--r--common/rfb/VNCSConnectionST.cxx3
5 files changed, 24 insertions, 14 deletions
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index 4bf0f932..20182a07 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -37,13 +37,14 @@ using namespace rfb;
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 f7124173..0379b17f 100644
--- a/common/rfb/SConnection.h
+++ b/common/rfb/SConnection.h
@@ -122,13 +122,14 @@ namespace rfb {
// 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 ae2fd247..b11a352a 100644
--- a/common/rfb/ServerCore.cxx
+++ b/common/rfb/ServerCore.cxx
@@ -89,6 +89,10 @@ rfb::BoolParameter rfb::Server::sendCutText
("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 e12a8bc8..5fc996ff 100644
--- a/common/rfb/ServerCore.h
+++ b/common/rfb/ServerCore.h
@@ -46,6 +46,7 @@ namespace rfb {
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 618048a5..274c496b 100644
--- a/common/rfb/VNCSConnectionST.cxx
+++ b/common/rfb/VNCSConnectionST.cxx
@@ -584,6 +584,9 @@ void VNCSConnectionST::setDesktopSize(int fb_width, int fb_height,
{
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,