File libgnomesu-set-xdg_runtime_dir.patch of Package libgnomesu.1421
commit fde8e83f5ff013656f7478d68456e98ee84e6cdc
Author: Dominique Leuenberger a.k.a. Dimstar <dimstar@opensuse.org>
Date: Fri Feb 6 10:43:53 2015 +0000
Properly rest XDG_RUNTIME_DIR to the new user (boo#908167)
Add libgnomesu-set-xdg_runtime_dir.patch: explicitly set
XDG_RUNTIME_DIR for the new user (boo#908167).
diff --git a/su-backend/common.c b/su-backend/common.c
index 3e1ea17..3fe8929 100644
--- a/su-backend/common.c
+++ b/su-backend/common.c
@@ -177,6 +177,9 @@ modify_environment (const struct passwd *pw)
xputenv (concat ("USER", "=", pw->pw_name));
xputenv (concat ("LOGNAME", "=", pw->pw_name));
+ /* set XDG_RUNTIME_DIR for the new user */
+ xputenv (g_strdup_printf("XDG_RUNTIME_DIR=/run/user/%d", pw->pw_uid));
+
/* Sanity-check PATH. It shouldn't contain . entries! */
path = g_getenv ("PATH");
if (path && (strstr (path, ":.:") || strncmp (path, ".:", 2) == 0