mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-12-23 23:29:05 +01:00
Writer perms were checked in multiple places, consolidate and fix a missing case
This commit is contained in:
parent
aefdb1392f
commit
7a695c976e
@ -252,4 +252,7 @@ namespace rfb {
|
||||
bool hasLocalClipboard;
|
||||
};
|
||||
}
|
||||
|
||||
#define WRITER_PERMS (AccessKeyEvents | AccessPtrEvents | AccessCutText | AccessSetDesktopSize)
|
||||
|
||||
#endif
|
||||
|
@ -86,8 +86,9 @@ VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s,
|
||||
}
|
||||
|
||||
bool write, owner;
|
||||
if (!getPerms(write, owner) || !write)
|
||||
accessRights = (accessRights & ~(AccessPtrEvents | AccessKeyEvents | AccessSetDesktopSize));
|
||||
if (!getPerms(write, owner) || !write) {
|
||||
accessRights &= ~WRITER_PERMS;
|
||||
}
|
||||
|
||||
// Configure the socket
|
||||
setSocketTimeouts();
|
||||
@ -1216,9 +1217,9 @@ void VNCSConnectionST::writeFramebufferUpdate()
|
||||
close("User was deleted");
|
||||
return;
|
||||
} else if (!write) {
|
||||
accessRights = (accessRights & ~(AccessPtrEvents | AccessKeyEvents | AccessSetDesktopSize));
|
||||
accessRights &= ~WRITER_PERMS;
|
||||
} else {
|
||||
accessRights |= AccessPtrEvents | AccessKeyEvents | AccessSetDesktopSize;
|
||||
accessRights |= WRITER_PERMS;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ namespace rfb {
|
||||
|
||||
bool write, owner;
|
||||
if (!getPerms(write, owner) || !write)
|
||||
accessRights = (accessRights & ~(AccessPtrEvents | AccessKeyEvents));
|
||||
accessRights &= ~WRITER_PERMS;
|
||||
needsPermCheck = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user