Kaynağa Gözat

Add AccessSetDesktopSize right.

So clients with limited access rights can not affect it.
tags/v1.4.90
Michal Srb 9 yıl önce
ebeveyn
işleme
b318b8f978

+ 8
- 7
common/rfb/SConnection.cxx Dosyayı Görüntüle

@@ -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_)

+ 8
- 7
common/rfb/SConnection.h Dosyayı Görüntüle

@@ -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

+ 4
- 0
common/rfb/ServerCore.cxx Dosyayı Görüntüle

@@ -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.",

+ 1
- 0
common/rfb/ServerCore.h Dosyayı Görüntüle

@@ -46,6 +46,7 @@ namespace rfb {
static BoolParameter acceptPointerEvents;
static BoolParameter acceptCutText;
static BoolParameter sendCutText;
static BoolParameter acceptSetDesktopSize;
static BoolParameter queryConnect;

};

+ 3
- 0
common/rfb/VNCSConnectionST.cxx Dosyayı Görüntüle

@@ -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,

Loading…
İptal
Kaydet