From d626b99839eb2cf915d96b4048d31e6622ad00ca Mon Sep 17 00:00:00 2001 From: Sebastien Braun Date: Mon, 11 Oct 2010 00:52:21 +0200 Subject: Add access control check to input event handling in PVS daemon --- src/pvs.cpp | 13 +++++++++++-- src/pvs.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pvs.cpp b/src/pvs.cpp index 96a92ea..e0605c2 100755 --- a/src/pvs.cpp +++ b/src/pvs.cpp @@ -199,8 +199,11 @@ void PVS::onCommand(PVSMsg cmdMessage) if (ident.compare("INPUTEVENT") == 0) { InputEvent evt; - eventFromString(message, evt); - handleInputEvent(evt); + if(inputEventsAllowed()) + { + eventFromString(message, evt); + handleInputEvent(evt); + } } if (ident.compare("MCASTFTRETRY") == 0) { @@ -749,6 +752,12 @@ bool PVS::createMulticastTransfer(QString const& objectPath, quint64& transferID // Input handling +bool PVS::inputEventsAllowed() +{ + QString lecturer = getConfigValue("Permissions/vnc_lecturer"); + return r == "rw"; +} + void PVS::handleInputEvent(InputEvent const& evt) { QString s = evt.toString(); diff --git a/src/pvs.h b/src/pvs.h index 902fbe7..27ea2fc 100755 --- a/src/pvs.h +++ b/src/pvs.h @@ -169,6 +169,7 @@ private: // input event handling: InputEventHandlerChain _inputEventHandlers; + bool inputEventsAllowed(); void handleInputEvent(InputEvent const& evt); void initializeInputEventHandling(); -- cgit v1.2.3-55-g7522