From dd8d208e8d1e8852f6f8f16dbac81e461a71dd99 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 7 Nov 2022 13:17:27 +0100 Subject: [PATCH] Don't do access checks on early clients They don't get access bits until they've been authenticated, so avoid doing any checks on clients in those early states. --- win/winvnc/VNCServerWin32.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx index 34cda378..79769e93 100644 --- a/win/winvnc/VNCServerWin32.cxx +++ b/win/winvnc/VNCServerWin32.cxx @@ -364,9 +364,11 @@ void VNCServerWin32::getConnInfo(ListConnInfo * listConn) if (!conn) continue; - if (conn->accessCheck(rfb::SConnection::AccessPtrEvents | - rfb::SConnection::AccessKeyEvents | - rfb::SConnection::AccessView)) + if (!conn->authenticated()) + status = 3; + else if (conn->accessCheck(rfb::SConnection::AccessPtrEvents | + rfb::SConnection::AccessKeyEvents | + rfb::SConnection::AccessView)) status = 0; else if (conn->accessCheck(rfb::SConnection::AccessView)) status = 1; -- 2.39.5