Blame 0002-lib-don-t-fail-loading-if-logind-isn-t-working-right.patch

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