From: Pierre Ossman Date: Fri, 21 Aug 2020 13:53:59 +0000 (+0200) Subject: Hide base SConnection methods from VNCServerST X-Git-Tag: v1.11.90~108 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ebd1b4db1540670200f2a936161999672a64be02;p=tigervnc.git Hide base SConnection methods from VNCServerST It should be using the safe wrappers for everything so make sure it cannot bypass those and call the SConnection methods directly. --- diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h index c8f4c24f..617e3c39 100644 --- a/common/rfb/VNCSConnectionST.h +++ b/common/rfb/VNCSConnectionST.h @@ -37,7 +37,7 @@ namespace rfb { class VNCServerST; - class VNCSConnectionST : public SConnection, + class VNCSConnectionST : private SConnection, public Timer::Callback { public: VNCSConnectionST(VNCServerST* server_, network::Socket* s, bool reverse); @@ -48,6 +48,8 @@ namespace rfb { virtual bool accessCheck(AccessRights ar) const; virtual void close(const char* reason); + using SConnection::authenticated; + // Methods called from VNCServerST. None of these methods ever knowingly // throw an exception. diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index f09715a4..17e963e8 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -599,7 +599,7 @@ SConnection* VNCServerST::getConnection(network::Socket* sock) { std::list::iterator ci; for (ci = clients.begin(); ci != clients.end(); ci++) { if ((*ci)->getSock() == sock) - return *ci; + return (SConnection*)*ci; } return 0; }