diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/display.c | 13 | ||||
-rwxr-xr-x | src/gdmflexiserver | 22 | ||||
-rw-r--r-- | src/process.c | 7 | ||||
-rw-r--r-- | src/process.h | 2 |
6 files changed, 49 insertions, 0 deletions
@@ -1,6 +1,8 @@ Overview of changes in lightdm 0.9.3 * Unlock ConsoleKit sessions when switching to them + * Add a gdmflexiserver binary that provides backwards compatibility with + existing sessions Overview of changes in lightdm 0.9.2 diff --git a/src/Makefile.am b/src/Makefile.am index 9687c4c4..8fc14fd3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,7 @@ sbin_PROGRAMS = lightdm +dist_pkglibexec_SCRIPTS = gdmflexiserver + ldm-marshal.c: ldm-marshal.list @GLIB_GENMARSHAL@ --prefix=ldm_marshal $(srcdir)/ldm-marshal.list --header --body > ldm-marshal.c @@ -69,6 +71,7 @@ BUILT_SOURCES = \ lightdm_CFLAGS = \ $(LIGHTDM_CFLAGS) \ $(WARN_CFLAGS) \ + -DPKGLIBEXEC_DIR=\"$(pkglibexecdir)\" \ -DCONFIG_DIR=\"$(sysconfdir)/lightdm\" \ -DLOG_DIR=\"$(localstatedir)/log/lightdm\" \ -DRUN_DIR=\"$(localstatedir)/run/lightdm\" \ diff --git a/src/display.c b/src/display.c index e34b36a3..6eff5fe9 100644 --- a/src/display.c +++ b/src/display.c @@ -585,6 +585,7 @@ create_session (Display *display, PAMSession *pam_session, const gchar *session_ { User *user; gchar *sessions_dir, *filename, *path, *command = NULL; + const gchar *orig_path; GKeyFile *session_desktop_file; Session *session; gchar *cookie; @@ -652,6 +653,18 @@ create_session (Display *display, PAMSession *pam_session, const gchar *session_ set_env_from_pam_session (session, pam_session); + /* Insert our own utility directory to PATH + * This is to provide gdmflexiserver which provides backwards compatibility with GDM. + * This can be removed when this is no longer required. + */ + orig_path = process_get_env (PROCESS (session), "PATH"); + if (orig_path) + { + path = g_strdup_printf ("%s:%s", PKGLIBEXEC_DIR, orig_path); + process_set_env (PROCESS (session), "PATH", path); + g_free (path); + } + process_set_log_file (PROCESS (session), log_filename); /* Open ConsoleKit session */ diff --git a/src/gdmflexiserver b/src/gdmflexiserver new file mode 100755 index 00000000..3168e177 --- /dev/null +++ b/src/gdmflexiserver @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copyright (C) 2011 Canonical Ltd +# Author: Michael Terry <michael.terry@canonical.com> +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, version 3 of the License. +# +# See http://www.gnu.org/copyleft/gpl.html for the full text of the license. + +SEAT=$(dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager /org/freedesktop/DisplayManager org.freedesktop.DisplayManager.GetSeatForCookie string:"$XDG_SESSION_COOKIE" 2>/dev/null) + +# Pull out seat path +SEAT=$(echo $SEAT | sed 's/.* object path "\(.*\)"/\1/') + +if [ -z "$SEAT" ]; then + # something went wrong + exit 1 +fi + +dbus-send --system --type=method_call --print-reply --dest=org.freedesktop.DisplayManager $SEAT org.freedesktop.DisplayManager.Seat.SwitchToGreeter diff --git a/src/process.c b/src/process.c index 286f7323..e51acab9 100644 --- a/src/process.c +++ b/src/process.c @@ -97,6 +97,13 @@ process_set_env (Process *process, const gchar *name, const gchar *value) g_hash_table_insert (process->priv->env, g_strdup (name), g_strdup (value)); } +const gchar * +process_get_env (Process *process, const gchar *name) +{ + g_return_val_if_fail (process != NULL, FALSE); + return g_hash_table_lookup (process->priv->env, name); +} + static void process_watch_cb (GPid pid, gint status, gpointer data) { diff --git a/src/process.h b/src/process.h index 4e739d60..60c95264 100644 --- a/src/process.h +++ b/src/process.h @@ -53,6 +53,8 @@ const gchar *process_get_log_file (Process *process); void process_set_env (Process *process, const gchar *name, const gchar *value); +const gchar *process_get_env (Process *process, const gchar *name); + gboolean process_start (Process *process, User *user, const gchar *working_dir, |