diff options
author | Mikle Kolyada <zlogene@gentoo.org> | 2019-03-19 12:16:40 +0300 |
---|---|---|
committer | Mikle Kolyada <zlogene@gentoo.org> | 2019-03-19 12:17:27 +0300 |
commit | 8dfe0d5537c0a504a3ff6e7af84c6bf20d51a5f6 (patch) | |
tree | 1d97d14781b254ffa49995ba7b24761f04c4b7f6 /mate-base | |
parent | profiles/selinux: disable FEATURE=pid-sandbox (diff) | |
download | gentoo-8dfe0d5537c0a504a3ff6e7af84c6bf20d51a5f6.tar.gz gentoo-8dfe0d5537c0a504a3ff6e7af84c6bf20d51a5f6.tar.bz2 gentoo-8dfe0d5537c0a504a3ff6e7af84c6bf20d51a5f6.zip |
mate-base/mate-session-manager: fix regression on non-systemd profiles
Closes: https://bugs.gentoo.org/680832
Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11
Diffstat (limited to 'mate-base')
-rw-r--r-- | mate-base/mate-session-manager/files/mate-session-manager-1.22.0-fix-systemd-regression.patch | 65 | ||||
-rw-r--r-- | mate-base/mate-session-manager/mate-session-manager-1.22.0.ebuild | 2 |
2 files changed, 67 insertions, 0 deletions
diff --git a/mate-base/mate-session-manager/files/mate-session-manager-1.22.0-fix-systemd-regression.patch b/mate-base/mate-session-manager/files/mate-session-manager-1.22.0-fix-systemd-regression.patch new file mode 100644 index 000000000000..eccfe5b5b18e --- /dev/null +++ b/mate-base/mate-session-manager/files/mate-session-manager-1.22.0-fix-systemd-regression.patch @@ -0,0 +1,65 @@ +From 7f0a938467e4e3d57c68af1caa146a664458a911 Mon Sep 17 00:00:00 2001 +From: Victor Kareh <vkareh@redhat.com> +Date: Wed, 6 Mar 2019 09:20:36 -0500 +Subject: [PATCH] Guard against missing systemd + +--- + mate-session/gsm-systemd.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/mate-session/gsm-systemd.c b/mate-session/gsm-systemd.c +index da3f23b..d03cafd 100644 +--- a/mate-session/gsm-systemd.c ++++ b/mate-session/gsm-systemd.c +@@ -429,16 +429,31 @@ gsm_systemd_is_last_session_for_user (GsmSystemd *manager) + gboolean is_last_session; + int ret, i; + ++#ifdef HAVE_SYSTEMD + ret = sd_pid_get_session (getpid (), &session); ++#endif ++ ++ if (session == NULL) { ++ return FALSE; ++ } + + if (ret != 0) { ++ free (session); + return FALSE; + } + ++#ifdef HAVE_SYSTEMD + ret = sd_uid_get_sessions (getuid (), FALSE, &sessions); ++#endif ++ ++ if (sessions == NULL) { ++ free (session); ++ return FALSE; ++ } + + if (ret <= 0) { + free (session); ++ free (sessions); + return FALSE; + } + +@@ -450,7 +465,9 @@ gsm_systemd_is_last_session_for_user (GsmSystemd *manager) + if (g_strcmp0 (sessions[i], session) == 0) + continue; + ++#ifdef HAVE_SYSTEMD + ret = sd_session_get_state (sessions[i], &state); ++#endif + + if (ret != 0) + continue; +@@ -461,7 +478,9 @@ gsm_systemd_is_last_session_for_user (GsmSystemd *manager) + } + free (state); + ++#ifdef HAVE_SYSTEMD + ret = sd_session_get_type (sessions[i], &type); ++#endif + + if (ret != 0) + continue; diff --git a/mate-base/mate-session-manager/mate-session-manager-1.22.0.ebuild b/mate-base/mate-session-manager/mate-session-manager-1.22.0.ebuild index ed715c003091..9b948b230380 100644 --- a/mate-base/mate-session-manager/mate-session-manager-1.22.0.ebuild +++ b/mate-base/mate-session-manager/mate-session-manager-1.22.0.ebuild @@ -17,6 +17,8 @@ SLOT="0" IUSE="debug elibc_FreeBSD gnome-keyring ipv6 systemd +xtrans" +PATCHES=( "${FILESDIR}"/${P}-fix-systemd-regression.patch ) + # x11-misc/xdg-user-dirs{,-gtk} are needed to create the various XDG_*_DIRs, and # create .config/user-dirs.dirs which is read by glib to get G_USER_DIRECTORY_* # xdg-user-dirs-update is run during login (see 10-user-dirs-update-gnome below). |