Apply read-only perms upon connecting

This commit is contained in:
Lauri Kasanen
2020-10-12 14:45:31 +03:00
parent 9a5afc5a62
commit 263d05a296
7 changed files with 91 additions and 9 deletions

View File

@@ -184,7 +184,13 @@ namespace rfb {
// of a VNCSConnectioST to the server. These access rights are applied
// such that the actual rights granted are the minimum of the server's
// default access settings and the connection's access settings.
virtual void setAccessRights(AccessRights ar) {accessRights=ar;}
virtual void setAccessRights(AccessRights ar) {
accessRights = ar;
bool write, owner;
if (!getPerms(write, owner) || !write)
accessRights = (accessRights & ~(AccessPtrEvents | AccessKeyEvents));
}
// Timer callbacks
virtual bool handleTimeout(Timer* t);
@@ -193,6 +199,8 @@ namespace rfb {
bool isShiftPressed();
bool getPerms(bool &write, bool &owner) const;
// Congestion control
void writeRTTPing();
bool isCongested();
@@ -249,6 +257,9 @@ namespace rfb {
rdr::U64 bstats_total[BS_NUM];
struct timeval connStart;
char user[32];
char kasmpasswdpath[4096];
time_t lastEventTime;
time_t pointerEventTime;
Point pointerEventPos;