[gdm/wip/multi-seat-2-30] Require newer GConf so that a11y works. Note that if you need to build GDM with an older GDM, you c
- From: Brian Cameron <bcameron src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/wip/multi-seat-2-30] Require newer GConf so that a11y works. Note that if you need to build GDM with an older GDM, you c
- Date: Fri, 16 Dec 2011 00:32:41 +0000 (UTC)
commit 3bcf12203230db8a76bdf2678dc3ba53bc3d90c2
Author: Brian Cameron <brian cameron oracle com>
Date: Thu Dec 15 18:28:32 2011 -0600
Require newer GConf so that a11y works. Note that if you need to build
GDM with an older GDM, you can workaround this by patching the configure
script to hardcode the gconf_defaultpath variable to the location of
the GConf system path file (normally "/etc/gconf/2/path"). The only
reason GDM requires the newer version of GConf is to set this variable
without hardcoding.
configure.ac | 5 ++++-
daemon/gdm-welcome-session.c | 42 +++++++++++++++++++++++++++++++++++++++---
data/gconf.path | 4 ++++
3 files changed, 47 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3bb3866..304bdc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,7 @@ GLIB_REQUIRED_VERSION=2.22.0
GTK_REQUIRED_VERSION=2.12.0
PANGO_REQUIRED_VERSION=1.3.0
SCROLLKEEPER_REQUIRED_VERSION=0.1.4
-GCONF_REQUIRED_VERSION=2.6.1
+GCONF_REQUIRED_VERSION=2.31.3
GNOME_PANEL_REQUIRED_VERSION=2.0.0
LIBXKLAVIER_REQUIRED_VERSION=4.0
LIBCANBERRA_GTK_REQUIRED_VERSION=0.4
@@ -103,6 +103,9 @@ PKG_CHECK_MODULES(GCONF,
AC_SUBST(GCONF_CFLAGS)
AC_SUBST(GCONF_LIBS)
+gconf_defaultpath=`pkg-config gconf-2.0 --variable=gconf_defaultpath`
+AC_DEFINE_UNQUOTED([GCONF_DEFAULTPATH], "$gconf_defaultpath", [GConf Default Path])
+
PKG_CHECK_MODULES(DEVKIT_POWER,
devkit-power-gobject >= $DEVKIT_POWER_REQUIRED_VERSION,
have_devicekit_power=yes,
diff --git a/daemon/gdm-welcome-session.c b/daemon/gdm-welcome-session.c
index 426e3d0..3967b2b 100644
--- a/daemon/gdm-welcome-session.c
+++ b/daemon/gdm-welcome-session.c
@@ -362,7 +362,7 @@ next_line:
}
static GPtrArray *
-get_welcome_environment (GdmWelcomeSession *welcome_session)
+get_welcome_environment (GdmWelcomeSession *welcome_session, gboolean start_session)
{
GPtrArray *env;
GHashTable *hash;
@@ -442,6 +442,15 @@ get_welcome_environment (GdmWelcomeSession *welcome_session)
g_hash_table_insert (hash, g_strdup ("SHELL"), g_strdup (pwent->pw_shell));
}
+ if (start_session && welcome_session->priv->x11_display_seat_id != NULL) {
+ char *seat_id;
+
+ seat_id = welcome_session->priv->x11_display_seat_id +
+ strlen ("/org/freedesktop/ConsoleKit/");
+
+ g_hash_table_insert (hash, g_strdup ("GCONF_DEFAULT_SOURCE_PATH"), g_strdup (GCONF_DEFAULTPATH));
+ g_hash_table_insert (hash, g_strdup ("GDM_SEAT_ID"), g_strdup (seat_id));
+ }
g_hash_table_insert (hash, g_strdup ("PATH"), g_strdup (g_getenv ("PATH")));
g_hash_table_insert (hash, g_strdup ("WINDOWPATH"), g_strdup (g_getenv ("WINDOWPATH")));
@@ -537,6 +546,7 @@ typedef struct {
const char *group_name;
const char *runtime_dir;
const char *log_file;
+ const char *seat_id;
} SpawnChildData;
static void
@@ -564,6 +574,26 @@ spawn_child_setup (SpawnChildData *data)
_exit (1);
}
+ if (pwent->pw_dir != NULL) {
+ struct stat statbuf;
+ const char *seat_id;
+ char *gconf_dir;
+ int r;
+
+ seat_id = data->seat_id + strlen ("/org/freedesktop/ConsoleKit/");
+ gconf_dir = g_strdup_printf ("%s/%s", pwent->pw_dir, seat_id);
+
+ /* Verify per-seat gconf directory exists, create if needed */
+ r = g_stat (gconf_dir, &statbuf);
+ if (r < 0) {
+ g_debug ("Making per-seat gconf directory %s", gconf_dir);
+ g_mkdir (gconf_dir, S_IRWXU | S_IXGRP | S_IRGRP);
+ g_chmod (gconf_dir, S_IRWXU | S_IXGRP | S_IRGRP);
+ chown (gconf_dir, pwent->pw_uid, grent->gr_gid);
+ }
+ g_free (gconf_dir);
+ }
+
g_debug ("GdmWelcomeSession: Setting up run time dir %s", data->runtime_dir);
g_mkdir (data->runtime_dir, 0755);
res = chown (data->runtime_dir, pwent->pw_uid, pwent->pw_gid);
@@ -633,6 +663,7 @@ static gboolean
spawn_command_line_sync_as_user (const char *command_line,
const char *user_name,
const char *group_name,
+ const char *seat_id,
const char *runtime_dir,
const char *log_file,
char **env,
@@ -661,6 +692,7 @@ spawn_command_line_sync_as_user (const char *command_line,
data.group_name = group_name;
data.runtime_dir = runtime_dir;
data.log_file = log_file;
+ data.seat_id = seat_id;
local_error = NULL;
res = g_spawn_sync (NULL,
@@ -691,6 +723,7 @@ static gboolean
spawn_command_line_async_as_user (const char *command_line,
const char *user_name,
const char *group_name,
+ const char *seat_id,
const char *runtime_dir,
const char *log_file,
char **env,
@@ -717,6 +750,7 @@ spawn_command_line_async_as_user (const char *command_line,
data.group_name = group_name;
data.runtime_dir = runtime_dir;
data.log_file = log_file;
+ data.seat_id = seat_id;
local_error = NULL;
res = g_spawn_async (NULL,
@@ -829,7 +863,7 @@ start_dbus_daemon (GdmWelcomeSession *welcome_session)
g_debug ("GdmWelcomeSession: Starting D-Bus daemon");
- env = get_welcome_environment (welcome_session);
+ env = get_welcome_environment (welcome_session, FALSE);
std_out = NULL;
std_err = NULL;
@@ -837,6 +871,7 @@ start_dbus_daemon (GdmWelcomeSession *welcome_session)
res = spawn_command_line_sync_as_user (DBUS_LAUNCH_COMMAND,
welcome_session->priv->user_name,
welcome_session->priv->group_name,
+ welcome_session->priv->x11_display_seat_id,
welcome_session->priv->runtime_dir,
NULL, /* log file */
(char **)env->pdata,
@@ -891,7 +926,7 @@ gdm_welcome_session_spawn (GdmWelcomeSession *welcome_session)
/* FIXME: */
}
- env = get_welcome_environment (welcome_session);
+ env = get_welcome_environment (welcome_session, TRUE);
error = NULL;
@@ -902,6 +937,7 @@ gdm_welcome_session_spawn (GdmWelcomeSession *welcome_session)
ret = spawn_command_line_async_as_user (welcome_session->priv->command,
welcome_session->priv->user_name,
welcome_session->priv->group_name,
+ welcome_session->priv->x11_display_seat_id,
welcome_session->priv->runtime_dir,
log_path,
(char **)env->pdata,
diff --git a/data/gconf.path b/data/gconf.path
index beaa55a..b195a3a 100644
--- a/data/gconf.path
+++ b/data/gconf.path
@@ -6,3 +6,7 @@ xml:readonly:/etc/gconf/gconf.xml.system
# owned by GDM. Sysadmins should create
# another source if they wish to override them.
xml:readonly:$(HOME)/.gconf.mandatory
+
+# Set per-seat configuration directory
+xml:readwrite:$(HOME)/$(ENV_GDM_SEAT_ID)/.gconf
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]