From: Robert Ancell Date: Sat, 6 Aug 2011 14:52:06 +0000 (+0200) Subject: Add a gdmflexiserver binary that provides backwards compatibility with existing sessions X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/lightdm.git/commitdiff_plain/6c7a1a961f168fd5b96e85964fda761c36eb91f9 Add a gdmflexiserver binary that provides backwards compatibility with existing sessions --- 6c7a1a961f168fd5b96e85964fda761c36eb91f9 diff --cc NEWS index 7b5f92eb,882a3778..21e9fe07 --- a/NEWS +++ b/NEWS @@@ -1,7 -1,3 +1,9 @@@ +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 * Fix annotation and Vala bindings for getting the UserList singleton diff --cc src/Makefile.am index 9687c4c4,07275f71..8fc14fd3 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -1,5 -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 diff --cc src/display.c index e34b36a3,0cfa7260..6eff5fe9 --- a/src/display.c +++ b/src/display.c @@@ -584,7 -584,7 +584,8 @@@ static Session create_session (Display *display, PAMSession *pam_session, const gchar *session_name, gboolean is_greeter, const gchar *log_filename) { User *user; - gchar *sessions_dir, *filename, *path, *orig_path, *command = NULL; + gchar *sessions_dir, *filename, *path, *command = NULL; ++ const gchar *orig_path; GKeyFile *session_desktop_file; Session *session; gchar *cookie; @@@ -652,6 -652,13 +653,18 @@@ set_env_from_pam_session (session, pam_session); - /* Insert our own utility directory to PATH */ ++ /* 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"); - path = g_strdup_printf ("%s:%s", PKGLIBEXEC_DIR, orig_path); - process_set_env (PROCESS (session), "PATH", path); - g_free (path); - g_free (orig_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 --cc src/gdmflexiserver index 00000000,3168e177..3168e177 mode 000000,100755..100755 --- a/src/gdmflexiserver +++ b/src/gdmflexiserver diff --cc src/process.c index 286f7323,babb0b19..e51acab9 --- a/src/process.c +++ b/src/process.c @@@ -97,6 -97,13 +97,13 @@@ process_set_env (Process *process, cons g_hash_table_insert (process->priv->env, g_strdup (name), g_strdup (value)); } -gchar * ++const gchar * + process_get_env (Process *process, const gchar *name) + { - g_return_if_fail (process != NULL); - return g_strdup (g_hash_table_lookup (process->priv->env, 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 --cc src/process.h index 4e739d60,eac071ee..60c95264 --- a/src/process.h +++ b/src/process.h @@@ -53,6 -53,8 +53,8 @@@ const gchar *process_get_log_file (Proc void process_set_env (Process *process, const gchar *name, const gchar *value); -gchar *process_get_env (Process *process, const gchar *name); ++const gchar *process_get_env (Process *process, const gchar *name); + gboolean process_start (Process *process, User *user, const gchar *working_dir,