Changeset View
Changeset View
Standalone View
Standalone View
recipes-support/sddm/sddm/0002-Workaround-missing-sessions.patch
- This file was added.
1 | From 68dbaac218216d001706c1a72d2db4819e3ca8cc Mon Sep 17 00:00:00 2001 | ||||
---|---|---|---|---|---|
2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com> | ||||
3 | Date: Sun, 25 Nov 2018 00:29:17 +0100 | ||||
4 | Subject: [PATCH] Workaround missing sessions | ||||
5 | MIME-Version: 1.0 | ||||
6 | Content-Type: text/plain; charset=UTF-8 | ||||
7 | Content-Transfer-Encoding: 8bit | ||||
8 | | ||||
9 | The current approach is wrong in many ways: | ||||
10 | | ||||
11 | * In case a session file does not set TryExec it is kept enabled accidentlty | ||||
12 | * Session files with TryExec without full path are ignored. Problem here: sddm | ||||
13 | tries to find executables based on PATH environment. Problem at least for my | ||||
14 | environment: There is no PATH variable set by systemd. So for session files | ||||
15 | without path: Do not perform further checks / just trust for now. | ||||
16 | | ||||
17 | Upstream-Sttaus: Pending | ||||
18 | | ||||
19 | Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> | ||||
20 | --- | ||||
21 | src/greeter/SessionModel.cpp | 19 ++++--------------- | ||||
22 | 1 file changed, 4 insertions(+), 15 deletions(-) | ||||
23 | | ||||
24 | diff --git a/src/greeter/SessionModel.cpp b/src/greeter/SessionModel.cpp | ||||
25 | index 2a3c091..927bce2 100644 | ||||
26 | --- a/src/greeter/SessionModel.cpp | ||||
27 | +++ b/src/greeter/SessionModel.cpp | ||||
28 | @@ -124,22 +124,11 @@ namespace SDDM { | ||||
29 | | ||||
30 | Session *si = new Session(type, session); | ||||
31 | bool execAllowed = true; | ||||
32 | - QFileInfo fi(si->tryExec()); | ||||
33 | - if (fi.isAbsolute()) { | ||||
34 | - if (!fi.exists() || !fi.isExecutable()) | ||||
35 | + if(!si->tryExec().isEmpty()) { | ||||
36 | + QFileInfo fi(si->tryExec()); | ||||
37 | + if (fi.isAbsolute()) { | ||||
38 | + if (!fi.exists() || !fi.isExecutable()) | ||||
39 | execAllowed = false; | ||||
40 | - } else { | ||||
41 | - execAllowed = false; | ||||
42 | - QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); | ||||
43 | - QString envPath = env.value(QStringLiteral("PATH")); | ||||
44 | - QStringList pathList = envPath.split(QLatin1Char(':')); | ||||
45 | - foreach(const QString &path, pathList) { | ||||
46 | - QDir pathDir(path); | ||||
47 | - fi.setFile(pathDir, si->tryExec()); | ||||
48 | - if (fi.exists() && fi.isExecutable()) { | ||||
49 | - execAllowed = true; | ||||
50 | - break; | ||||
51 | - } | ||||
52 | } | ||||
53 | } | ||||
54 | // add to sessions list | ||||
55 | -- | ||||
56 | 2.14.5 | ||||
57 | |