Blame SOURCES/0003-systemd-login-Avoid-a-crash-on-container.patch

fed39a
From 823d743394f5696887ed1622623f45f7190d59bf Mon Sep 17 00:00:00 2001
fed39a
From: Frediano Ziglio <fziglio@redhat.com>
fed39a
Date: Thu, 26 Mar 2020 11:31:50 +0000
fed39a
Subject: [PATCH 3/4] systemd-login: Avoid a crash on container
fed39a
fed39a
On containers dbus could be not running.
fed39a
In this case dbus.system_connection is NULL and calling
fed39a
dbus_connection_close on it will cause a crash.
fed39a
This happens also under Gitlab CI.
fed39a
fed39a
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
fed39a
Acked-by: Victor Toso <victortoso@redhat.com>
fed39a
(cherry picked from commit 5654f4d2f90f95efd1f0ca70b438a3ab81022d15)
fed39a
---
fed39a
 src/vdagentd/systemd-login.c | 4 +++-
fed39a
 1 file changed, 3 insertions(+), 1 deletion(-)
fed39a
fed39a
diff --git a/src/vdagentd/systemd-login.c b/src/vdagentd/systemd-login.c
fed39a
index 0b8f3c1..2d2311c 100644
fed39a
--- a/src/vdagentd/systemd-login.c
fed39a
+++ b/src/vdagentd/systemd-login.c
fed39a
@@ -250,7 +250,9 @@ void session_info_destroy(struct session_info *si)
fed39a
         return;
fed39a
 
fed39a
     si_dbus_match_remove(si);
fed39a
-    dbus_connection_close(si->dbus.system_connection);
fed39a
+    if (si->dbus.system_connection) {
fed39a
+        dbus_connection_close(si->dbus.system_connection);
fed39a
+    }
fed39a
     sd_login_monitor_unref(si->mon);
fed39a
     g_free(si->session);
fed39a
     g_free(si);
fed39a
-- 
fed39a
2.26.1
fed39a