|
|
f42647 |
From be25f936f6568af9019bf446c3cf2a19de5e167f Mon Sep 17 00:00:00 2001
|
|
|
2fc437 |
From: Ray Strode <rstrode@localhost.localdomain>
|
|
|
2fc437 |
Date: Fri, 12 May 2017 15:20:14 -0400
|
|
|
2fc437 |
Subject: [PATCH] worker: add compat patch to make new worker work with old
|
|
|
2fc437 |
daemon
|
|
|
2fc437 |
|
|
|
2fc437 |
---
|
|
|
2fc437 |
daemon/gdm-session-worker.c | 17 +++++++++++++++++
|
|
|
2fc437 |
1 file changed, 17 insertions(+)
|
|
|
2fc437 |
|
|
|
2fc437 |
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
|
|
|
f42647 |
index 10ecccb0..f71594c2 100644
|
|
|
2fc437 |
--- a/daemon/gdm-session-worker.c
|
|
|
2fc437 |
+++ b/daemon/gdm-session-worker.c
|
|
|
f42647 |
@@ -3140,69 +3140,86 @@ gdm_session_worker_handle_setup_for_user (GdmDBusWorker *object,
|
|
|
2fc437 |
static gboolean
|
|
|
2fc437 |
gdm_session_worker_handle_setup_for_program (GdmDBusWorker *object,
|
|
|
2fc437 |
GDBusMethodInvocation *invocation,
|
|
|
2fc437 |
const char *service,
|
|
|
2fc437 |
const char *username,
|
|
|
2fc437 |
const char *x11_display_name,
|
|
|
2fc437 |
const char *x11_authority_file,
|
|
|
2fc437 |
const char *console,
|
|
|
2fc437 |
const char *seat_id,
|
|
|
2fc437 |
const char *hostname,
|
|
|
2fc437 |
gboolean display_is_local,
|
|
|
2fc437 |
const char *log_file)
|
|
|
2fc437 |
{
|
|
|
2fc437 |
GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
|
|
|
2fc437 |
validate_and_queue_state_change (worker, invocation, GDM_SESSION_WORKER_STATE_SETUP_COMPLETE);
|
|
|
2fc437 |
|
|
|
2fc437 |
worker->priv->service = g_strdup (service);
|
|
|
2fc437 |
worker->priv->x11_display_name = g_strdup (x11_display_name);
|
|
|
2fc437 |
worker->priv->x11_authority_file = g_strdup (x11_authority_file);
|
|
|
2fc437 |
worker->priv->display_device = g_strdup (console);
|
|
|
2fc437 |
worker->priv->display_seat_id = g_strdup (seat_id);
|
|
|
2fc437 |
worker->priv->hostname = g_strdup (hostname);
|
|
|
2fc437 |
worker->priv->display_is_local = display_is_local;
|
|
|
2fc437 |
worker->priv->username = g_strdup (username);
|
|
|
2fc437 |
worker->priv->log_file = g_strdup (log_file);
|
|
|
2fc437 |
worker->priv->is_program_session = TRUE;
|
|
|
2fc437 |
|
|
|
2fc437 |
return TRUE;
|
|
|
2fc437 |
}
|
|
|
2fc437 |
|
|
|
2fc437 |
+static void
|
|
|
2fc437 |
+fix_environment_if_old_gdm_daemon_running (GdmSessionWorker *worker)
|
|
|
2fc437 |
+{
|
|
|
2fc437 |
+ const char *daemon_version;
|
|
|
2fc437 |
+ const char *username;
|
|
|
2fc437 |
+
|
|
|
2fc437 |
+ daemon_version = gdm_session_worker_get_environment_variable (worker, "GDM_VERSION");
|
|
|
2fc437 |
+ username = gdm_session_worker_get_environment_variable (worker, "USERNAME");
|
|
|
2fc437 |
+
|
|
|
2fc437 |
+ if (g_strcmp0 (daemon_version, "3.14.2") == 0 &&
|
|
|
2fc437 |
+ g_strcmp0 (username, "gdm") == 0) {
|
|
|
2fc437 |
+ gdm_session_worker_set_environment_variable (worker, "GNOME_SHELL_SESSION_MODE", "gdm");
|
|
|
2fc437 |
+ }
|
|
|
2fc437 |
+}
|
|
|
2fc437 |
+
|
|
|
2fc437 |
static gboolean
|
|
|
2fc437 |
gdm_session_worker_handle_start_program (GdmDBusWorker *object,
|
|
|
2fc437 |
GDBusMethodInvocation *invocation,
|
|
|
2fc437 |
const char *text)
|
|
|
2fc437 |
{
|
|
|
2fc437 |
GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
|
|
|
2fc437 |
GError *parse_error = NULL;
|
|
|
2fc437 |
validate_state_change (worker, invocation, GDM_SESSION_WORKER_STATE_SESSION_STARTED);
|
|
|
2fc437 |
|
|
|
2fc437 |
+ fix_environment_if_old_gdm_daemon_running (worker);
|
|
|
2fc437 |
+
|
|
|
2fc437 |
if (worker->priv->is_reauth_session) {
|
|
|
2fc437 |
g_dbus_method_invocation_return_error (invocation,
|
|
|
2fc437 |
GDM_SESSION_WORKER_ERROR,
|
|
|
2fc437 |
GDM_SESSION_WORKER_ERROR_IN_REAUTH_SESSION,
|
|
|
2fc437 |
"Cannot start a program while in a reauth session");
|
|
|
2fc437 |
return TRUE;
|
|
|
2fc437 |
}
|
|
|
2fc437 |
|
|
|
2fc437 |
g_debug ("GdmSessionWorker: start program: %s", text);
|
|
|
2fc437 |
|
|
|
2fc437 |
g_clear_pointer (&worker->priv->arguments, (GDestroyNotify) g_strfreev);
|
|
|
2fc437 |
if (! g_shell_parse_argv (text, NULL, &worker->priv->arguments, &parse_error)) {
|
|
|
2fc437 |
g_dbus_method_invocation_take_error (invocation, parse_error);
|
|
|
2fc437 |
return TRUE;
|
|
|
2fc437 |
}
|
|
|
2fc437 |
|
|
|
2fc437 |
worker->priv->pending_invocation = invocation;
|
|
|
2fc437 |
queue_state_change (worker);
|
|
|
2fc437 |
|
|
|
2fc437 |
return TRUE;
|
|
|
2fc437 |
}
|
|
|
2fc437 |
|
|
|
2fc437 |
static void
|
|
|
2fc437 |
on_reauthentication_client_connected (GdmSession *session,
|
|
|
2fc437 |
GCredentials *credentials,
|
|
|
2fc437 |
GPid pid_of_client,
|
|
|
2fc437 |
ReauthenticationRequest *request)
|
|
|
2fc437 |
{
|
|
|
2fc437 |
g_debug ("GdmSessionWorker: client connected to reauthentication server");
|
|
|
2fc437 |
}
|
|
|
2fc437 |
--
|
|
|
f42647 |
2.14.2
|
|
|
2fc437 |
|