Commit 74fed8d9 authored by Ray Strode's avatar Ray Strode

lib: don't fail loading if logind isn't working right

At the moment if logind can fail in two ways when
asking the session associated with the current pid:

1) ENOENT, the process isn't part of a registered session
2) ENODATA, the mechanism for checking which session a
process is registered with isn't working.

If we hit the second case then wefail loading the user manager
entirely.  This leads to the dbus proxy associated with a user
from loading and the user getting stuck with defaults like a
NULL xsession and systemaccount=TRUE

This commit changes the behavior for the second case to be
like the first. Namely, to accept there's no associated
session and carry on as best we can.
parent 8a96984f
......@@ -1139,12 +1139,9 @@ _get_current_systemd_session_id (ActUserManager *manager)
res = sd_pid_get_session (0, &session_id);
if (res == -ENOENT) {
session_id = NULL;
} else if (res < 0) {
g_debug ("Failed to identify the current session: %s",
strerror (-res));
unload_seat (manager);
session_id = NULL;
manager->priv->seat.session_id = g_strdup (session_id);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment