|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
From 74fed8d975fd2e2cba644eeb8021393fc81b7151 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
From: Ray Strode <rstrode@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
Date: Fri, 10 Aug 2018 15:15:51 -0400
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
Subject: [PATCH 3/3] lib: don't fail loading if logind isn't working right
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
At the moment if logind can fail in two ways when
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
asking the session associated with the current pid:
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
1) ENOENT, the process isn't part of a registered session
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
2) ENODATA, the mechanism for checking which session a
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
process is registered with isn't working.
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
If we hit the second case then wefail loading the user manager
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
entirely. This leads to the dbus proxy associated with a user
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
from loading and the user getting stuck with defaults like a
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
NULL xsession and systemaccount=TRUE
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
This commit changes the behavior for the second case to be
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
like the first. Namely, to accept there's no associated
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
session and carry on as best we can.
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
---
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
src/libaccountsservice/act-user-manager.c | 5 +----
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
1 file changed, 1 insertion(+), 4 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
diff --git a/src/libaccountsservice/act-user-manager.c b/src/libaccountsservice/act-user-manager.c
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
index e7e26b1..6dc1d15 100644
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
--- a/src/libaccountsservice/act-user-manager.c
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
+++ b/src/libaccountsservice/act-user-manager.c
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
@@ -1139,12 +1139,9 @@ _get_current_systemd_session_id (ActUserManager *manager)
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
res = sd_pid_get_session (0, &session_id);
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
if (res == -ENOENT) {
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
- session_id = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
- } else if (res < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
g_debug ("Failed to identify the current session: %s",
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
strerror (-res));
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
- unload_seat (manager);
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
- return;
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
+ session_id = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
}
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
manager->priv->seat.session_id = g_strdup (session_id);
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
--
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
2.19.0
|
|
![](https://seccdn.libravatar.org/avatar/8cab5fc45d9566e5b133cc0e4fe053af87c3acfb91fa86956de4462c37b28683?s=16&d=retro) |
b0e7050 |
|