Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.2:Update
sddm
0001-Fall-back-to-regular-login-when-autologin-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fall-back-to-regular-login-when-autologin-fails.patch of Package sddm
From 5f43cbf23a9ec9e3547dfe0f59928d0ac5324db9 Mon Sep 17 00:00:00 2001 From: Jerome Leclanche <jerome@leclan.ch> Date: Thu, 5 Nov 2015 21:28:22 +0200 Subject: [PATCH] Fall back to regular login when autologin fails Fixes #316 --- src/daemon/Display.cpp | 42 +++++++++++++++++++++++++----------------- src/daemon/Display.h | 1 + 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp index 8de59e5..6bc9965 100644 --- a/src/daemon/Display.cpp +++ b/src/daemon/Display.cpp @@ -103,6 +103,29 @@ namespace SDDM { m_displayServer->start(); } + bool Display::attemptAutologin() { + Session::Type sessionType = Session::X11Session; + + // determine session type + const QString &autologinSession = mainConfig.Autologin.Session.get(); + if (findSessionEntry(mainConfig.XDisplay.SessionDir.get(), autologinSession)) { + sessionType = Session::X11Session; + } else if (findSessionEntry(mainConfig.WaylandDisplay.SessionDir.get(), autologinSession)) { + sessionType = Session::WaylandSession; + } else { + qCritical() << "Unable to find autologin session entry" << autologinSession; + return false; + } + + Session session; + session.setTo(sessionType, autologinSession); + + m_auth->setAutologin(true); + startAuth(mainConfig.Autologin.User.get(), QString(), session); + + return true; + } + void Display::displayServerStarted() { // check flag if (m_started) @@ -122,25 +145,10 @@ namespace SDDM { // set flags m_started = true; - // determine session type - const QString &autologinSession = mainConfig.Autologin.Session.get(); - Session session; - if (findSessionEntry(mainConfig.XDisplay.SessionDir.get(), autologinSession)) { - session.setTo(Session::X11Session, autologinSession); - } else if (findSessionEntry(mainConfig.WaylandDisplay.SessionDir.get(), autologinSession)) { - session.setTo(Session::WaylandSession, autologinSession); - } else { - qCritical() << "Unable to find autologin session entry" << autologinSession; - emit loginFailed(m_socket); + bool success = attemptAutologin(); + if (success) { return; } - - // start session - m_auth->setAutologin(true); - startAuth(mainConfig.Autologin.User.get(), QString(), session); - - // return - return; } // start socket server diff --git a/src/daemon/Display.h b/src/daemon/Display.h index dc46463..3d6d6a5 100644 --- a/src/daemon/Display.h +++ b/src/daemon/Display.h @@ -60,6 +60,7 @@ namespace SDDM { void login(QLocalSocket *socket, const QString &user, const QString &password, const Session &session); + bool attemptAutologin(); void displayServerStarted(); signals: -- 2.10.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor