Remove shutdown option from screen locker

Logging out from the locked screen is impossible. Logging out means
interaction with the session due to the session manager. The session
manager asks all applications to quit and applications are allowed to
ask for example saving changes. The session manager stopps the
logout in this case and asks the window manager to focus this window
and the session manager will only continue the logout once the
application resolved the situation. At any time in this process the
user is still able to abort the logout!

Switching to the application which needs interaction is impossible,
though as the screen is still locked. The result is a seemingly
frozen system as the logout cannot continue and there is no indication
what is going on.

Of course the lock screen cannot unlock the session for the logout as
that would circumvent the security. If the lock screen would unlock
one would just have to click the button and abort the logout really
fast to have the system unlocked. So this is clearly not an option.

The result is: we cannot implement this functionality in a working
and secure manner, so it's better to remove it.

REVIEW: 120577
BUG: 339453
FIXED-IN: 5.1.1
wilder-5.14
Martin Gräßlin 12 years ago
parent e7f4743a07
commit ab190c149b
  1. 24
      ksmserver/screenlocker/greeter/greeterapp.cpp
  2. 1
      ksmserver/screenlocker/greeter/greeterapp.h
  3. 34
      lookandfeel/contents/lockscreen/LockScreen.qml

@ -23,8 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sessions.h"
#include "authenticator.h"
// workspace
#include <kworkspace.h>
// KDE
#include <KAuthorized>
#include <KCrash>
@ -182,13 +180,6 @@ void UnlockApp::desktopResized()
connect(view->rootObject(), SIGNAL(suspendToDisk()), SLOT(suspendToDisk()));
}
QQmlProperty shutdownProperty(view->rootObject(), QStringLiteral("shutdownSupported"));
shutdownProperty.write(canLogout);
if (canLogout &&
view->rootObject()->metaObject()->indexOfSignal(QMetaObject::normalizedSignature("shutdown()").constData()) != -1) {
connect(view->rootObject(), SIGNAL(shutdown()), SLOT(shutdown()));
}
m_views << view;
}
@ -291,21 +282,6 @@ void UnlockApp::suspendToDisk()
Solid::PowerManagement::requestSleep(Solid::PowerManagement::HibernateState, 0, 0);
}
void UnlockApp::shutdown()
{
if (m_ignoreRequests) {
return;
}
m_ignoreRequests = true;
m_resetRequestIgnoreTimer->start();
const KWorkSpace::ShutdownConfirm confirm = KWorkSpace::ShutdownConfirmNo;
const KWorkSpace::ShutdownType type = KWorkSpace::ShutdownTypeHalt;
KWorkSpace::requestShutDown(confirm, type);
}
void UnlockApp::setTesting(bool enable)
{
m_testing = enable;

@ -59,7 +59,6 @@ private Q_SLOTS:
void resetRequestIgnore();
void suspendToRam();
void suspendToDisk();
void shutdown();
void getFocus();
void setLockedPropertyOnViews();

@ -29,10 +29,8 @@ import "../components"
Image {
id: root
property bool debug: false
property bool shutdownSupported: true
property string notification
property UserSelect userSelect: null
signal shutdown()
signal clearPassword()
source: "../components/artwork/background.png"
@ -201,38 +199,6 @@ Image {
}
}
LogoutOptions {
id: logoutOptions
anchors.right: parent.right
anchors.rightMargin: 5
canReboot: false
canLogout: false
canShutdown: root.shutdownSupported
mode: ""
exclusive: false
onModeChanged: {
if(mode != "")
stackView.push(logoutScreenComponent, {"mode": logoutOptions.mode })
}
onVisibleChanged: if(visible) {
mode = ""
}
}
Component {
id: logoutScreenComponent
LogoutScreen {
canReboot: logoutOptions.canReboot
canLogout: logoutOptions.canLogout
canShutdown: logoutOptions.canShutdown
onCancel: stackView.pop()
onShutdownRequested: {
root.shutdown()
}
}
}
Component {
id: changeSessionComponent
BreezeBlock {

Loading…
Cancel
Save