From cb9f1c9c964b8ab6839850d8e7ae6719fb3544e3 Mon Sep 17 00:00:00 2001 From: Tim Jansen Date: Thu, 25 Jul 2002 20:58:42 +0000 Subject: [PATCH] Added KCM option to disable SLP announcements svn path=/trunk/kdenetwork/krfb/; revision=168752 --- TODO | 2 +- kcm_krfb/configurationwidget.ui | 32 +++++++++++++++++++++++++++++--- kcm_krfb/kcm_krfb.cpp | 4 ++++ krfb/configuration.cc | 12 +++++++++++- krfb/configuration.h | 3 +++ 5 files changed, 48 insertions(+), 5 deletions(-) diff --git a/TODO b/TODO index c47ed689..f2c2a2ec 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,7 @@ For 3.1: For 3.2: - enhance RFB with SASL authentication (Kerberos) -- encrypted connection (using SASL and/or SSL/TLS) +- encrypted connections (using SASL and/or SSL/TLS) Todo (unscheduled features): - NAT traversal support if I can find an acceptable implementation diff --git a/kcm_krfb/configurationwidget.ui b/kcm_krfb/configurationwidget.ui index 23903792..daacbab4 100644 --- a/kcm_krfb/configurationwidget.ui +++ b/kcm_krfb/configurationwidget.ui @@ -8,8 +8,8 @@ 0 0 - 420 - 354 + 421 + 445 @@ -143,6 +143,20 @@ Select this option to allow connecting without inviting. This is useful if you want to access your desktop remotely. + + + enableSLPCB + + + Announce &service on the network + + + true + + + If you allow uninvited connections and enable this option, Desktop Sharing will announce the service and your identity on the local network, so people can find you and your computer. + + confirmConnectionsCB @@ -159,7 +173,7 @@ allowDesktopControlCB - Allow u&ninvited connections to control the desktop + A&llow uninvited connections to control the desktop Enable this option to allow uninvited user to control your desktop (using mouse and keyboard). @@ -242,6 +256,12 @@ Expanding + + + 0 + 50 + + @@ -362,6 +382,12 @@ Most VNC clients use a display number instead of the actual port. This display n Expanding + + + 0 + 20 + + diff --git a/kcm_krfb/kcm_krfb.cpp b/kcm_krfb/kcm_krfb.cpp index 9ba5c6ce..10fe7440 100644 --- a/kcm_krfb/kcm_krfb.cpp +++ b/kcm_krfb/kcm_krfb.cpp @@ -66,6 +66,7 @@ KcmKRfb::KcmKRfb(QWidget *p, const char *name, const QStringList &) : connect(m_confWidget->passwordInput, SIGNAL(textChanged(const QString&)), SLOT(configChanged()) ); connect(m_confWidget->allowUninvitedCB, SIGNAL(clicked()), SLOT(configChanged()) ); + connect(m_confWidget->enableSLPCB, SIGNAL(clicked()), SLOT(configChanged()) ); connect(m_confWidget->confirmConnectionsCB, SIGNAL(clicked()), SLOT(configChanged()) ); connect(m_confWidget->allowDesktopControlCB, SIGNAL(clicked()), SLOT(configChanged()) ); connect(m_confWidget->autoPortCB, SIGNAL(clicked()), SLOT(configChanged()) ); @@ -117,6 +118,7 @@ void KcmKRfb::load() { checkKInetd(kinetdAvailable, krfbAvailable); m_confWidget->allowUninvitedCB->setChecked(m_configuration.allowUninvitedConnections()); + m_confWidget->enableSLPCB->setChecked(m_configuration.enableSLP()); m_confWidget->confirmConnectionsCB->setChecked(m_configuration.askOnConnect()); m_confWidget->allowDesktopControlCB->setChecked(m_configuration.allowDesktopControl()); m_confWidget->passwordInput->setText(m_configuration.password()); @@ -130,6 +132,7 @@ void KcmKRfb::save() { m_configuration.update(); bool allowUninvited = m_confWidget->allowUninvitedCB->isChecked(); m_configuration.setAllowUninvited(allowUninvited); + m_configuration.setEnableSLP(m_confWidget->enableSLPCB->isChecked()); m_configuration.setAskOnConnect(m_confWidget->confirmConnectionsCB->isChecked()); m_configuration.setAllowDesktopControl(m_confWidget->allowDesktopControlCB->isChecked()); m_configuration.setPassword(m_confWidget->passwordInput->text()); @@ -145,6 +148,7 @@ void KcmKRfb::defaults() { checkKInetd(kinetdAvailable, krfbAvailable); m_confWidget->allowUninvitedCB->setChecked(false); + m_confWidget->enableSLPCB->setChecked(true); m_confWidget->confirmConnectionsCB->setChecked(false); m_confWidget->allowDesktopControlCB->setChecked(false); m_confWidget->passwordInput->setText(""); diff --git a/krfb/configuration.cc b/krfb/configuration.cc index 33c57d40..ce15ae57 100644 --- a/krfb/configuration.cc +++ b/krfb/configuration.cc @@ -159,7 +159,7 @@ void Configuration::doKinetdConf() { if (allowUninvitedFlag) { setKInetdEnabled(true); - setKInetdServiceRegistrationEnabled(true); + setKInetdServiceRegistrationEnabled(enableSLPFlag); getPortFromKInetd(); return; } @@ -188,6 +188,7 @@ void Configuration::loadFromKConfig() { KConfig c("krfbrc"); allowUninvitedFlag = c.readBoolEntry("allowUninvited", false); + enableSLPFlag = c.readBoolEntry("enableSLP", true); askOnConnectFlag = c.readBoolEntry("confirmUninvitedConnection", true); allowDesktopControlFlag = c.readBoolEntry("allowDesktopControl", false); preferredPortNum = c.readNumEntry("preferredPort", -1); @@ -214,6 +215,7 @@ void Configuration::saveToKConfig() { c.writeEntry("confirmUninvitedConnection", askOnConnectFlag); c.writeEntry("allowDesktopControl", allowDesktopControlFlag); c.writeEntry("allowUninvited", allowUninvitedFlag); + c.writeEntry("enableSLP", enableSLPFlag); c.writeEntry("preferredPort", preferredPortNum); c.writeEntry("uninvitedPasswordCrypted", cryptStr(passwordString)); c.deleteEntry("uninvitedPassword"); @@ -303,6 +305,10 @@ bool Configuration::allowUninvitedConnections() const { return allowUninvitedFlag; } +bool Configuration::enableSLP() const { + return enableSLPFlag; +} + QString Configuration::password() const { return passwordString; } @@ -315,6 +321,10 @@ void Configuration::setAllowUninvited(bool allowUninvited) { allowUninvitedFlag = allowUninvited; } +void Configuration::setEnableSLP(bool e) { + enableSLPFlag = e; +} + void Configuration::setAskOnConnect(bool askOnConnect) { askOnConnectFlag = askOnConnect; diff --git a/krfb/configuration.h b/krfb/configuration.h index 267aa50a..c3dee171 100644 --- a/krfb/configuration.h +++ b/krfb/configuration.h @@ -77,12 +77,14 @@ public: bool askOnConnect() const; bool allowDesktopControl() const; bool allowUninvitedConnections() const; + bool enableSLP() const; QString password() const; QString hostname() const; int port() const; int preferredPort() const; void setAllowUninvited(bool allowUninvited); + void setEnableSLP(bool e); void setAskOnConnect(bool askOnConnect); void setPassword(QString password); void setPreferredPort(int p); @@ -127,6 +129,7 @@ private: bool askOnConnectFlag; bool allowDesktopControlFlag; bool allowUninvitedFlag; + bool enableSLPFlag; int portNum, preferredPortNum;