Bring some patches from upstream to fix a couple of bugs.

Properly remove some subdirectory under _gdm homedir.
This commit is contained in:
ajacoutot 2012-10-03 06:40:50 +00:00
parent 62f1447132
commit 9838b6110a
6 changed files with 264 additions and 4 deletions

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-configure,v 1.22 2012/09/29 19:28:15 ajacoutot Exp $
$OpenBSD: patch-configure,v 1.23 2012/10/03 06:40:50 ajacoutot Exp $
Fix DATADIRNAME: see LOCALBASE/share/aclocal/{glib-gettext.m4,intltool.m4}
--- configure.orig Tue Sep 25 20:04:03 2012
+++ configure Sat Sep 29 20:17:23 2012
+++ configure Tue Oct 2 10:37:01 2012
@@ -16948,6 +16948,9 @@ else
fi
@ -14,7 +14,7 @@ Fix DATADIRNAME: see LOCALBASE/share/aclocal/{glib-gettext.m4,intltool.m4}
*)
DATADIRNAME=lib
;;
@@ -26390,6 +26395,12 @@ else
@@ -26390,6 +26393,12 @@ else
am__EXEEXT_TRUE='#'
am__EXEEXT_FALSE=
fi

View File

@ -0,0 +1,88 @@
$OpenBSD: patch-daemon_gdm-session-worker_c,v 1.1 2012/10/03 06:40:50 ajacoutot Exp $
From 0fbe5f38740cb59d542241dae3457d6c0dcf2880 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 01 Oct 2012 21:51:23 +0000
Subject: worker: fix compiler warning
From 01c334ed94b64a3b2e9119e95e968db24dac5a31 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 01 Oct 2012 21:51:47 +0000
Subject: worker: create program session log file as root
--- daemon/gdm-session-worker.c.orig Mon Sep 17 22:41:25 2012
+++ daemon/gdm-session-worker.c Tue Oct 2 10:42:02 2012
@@ -1530,10 +1530,10 @@ gdm_session_worker_accredit_user (GdmSessionWorker *w
return ret;
}
-static char **
+static const char * const *
gdm_session_worker_get_environment (GdmSessionWorker *worker)
{
- return pam_getenvlist (worker->priv->pam_handle);
+ return (const char * const *) pam_getenvlist (worker->priv->pam_handle);
}
static void
@@ -1775,11 +1775,19 @@ gdm_session_worker_start_session (GdmSessionWorker *w
}
if (session_pid == 0) {
- char **environment;
+ const char * const * environment;
char *kerberos_cache;
char *home_dir;
int fd;
+ fd = open ("/dev/null", O_RDWR);
+ dup2 (fd, STDIN_FILENO);
+ close (fd);
+
+ if (worker->priv->is_program_session) {
+ fd = _open_program_session_log (worker->priv->log_file);
+ }
+
if (setuid (worker->priv->uid) < 0) {
g_debug ("GdmSessionWorker: could not reset uid: %s", g_strerror (errno));
_exit (1);
@@ -1791,7 +1799,6 @@ gdm_session_worker_start_session (GdmSessionWorker *w
_exit (2);
}
-
kerberos_cache = gdm_session_worker_get_environment_variable (worker, "KRB5CCNAME");
if (kerberos_cache == NULL) {
@@ -1823,13 +1830,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w
g_chdir ("/");
}
- fd = open ("/dev/null", O_RDWR);
- dup2 (fd, STDIN_FILENO);
- close (fd);
-
- if (worker->priv->is_program_session) {
- fd = _open_program_session_log (worker->priv->log_file);
- } else {
+ if (!worker->priv->is_program_session) {
if (home_dir != NULL && home_dir[0] != '\0') {
char *cache_dir;
char *log_dir;
@@ -1869,6 +1870,7 @@ gdm_session_worker_start_session (GdmSessionWorker *w
gdm_session_execute (worker->priv->arguments[0],
worker->priv->arguments,
+ (char **)
environment,
TRUE);
@@ -2693,7 +2695,7 @@ reauthentication_request_new (GdmSessionWorker *w
GDBusMethodInvocation *invocation)
{
ReauthenticationRequest *request;
- char **environment;
+ const char * const * environment;
char *address;
environment = gdm_session_worker_get_environment (worker);

View File

@ -0,0 +1,95 @@
$OpenBSD: patch-daemon_gdm-simple-slave_c,v 1.1 2012/10/03 06:40:50 ajacoutot Exp $
From 5479f2542c79873d3f36968bf081274ab9c241fd Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 28 Sep 2012 23:56:51 +0000
Subject: Fix errors in the setup code for gnome-initial-setup
From 6eeb747f1b056e6c10ad4390001ae094575d9c94 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Sat, 29 Sep 2012 03:19:27 +0000
Subject: Don't try to delete a NULL user
From 71f07f3aa22e3f6382d525d1a0104a9a792090f9 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Sat, 29 Sep 2012 03:20:18 +0000
Subject: Install polkit rules to the right place
From c32fef1406287ed324b1223837e7e7a539b86866 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 01 Oct 2012 21:54:59 +0000
Subject: slave: don't delete initial-setup user until after initial-setup is finished
--- daemon/gdm-simple-slave.c.orig Tue Sep 25 19:57:35 2012
+++ daemon/gdm-simple-slave.c Tue Oct 2 10:41:36 2012
@@ -115,6 +115,8 @@ static void gdm_simple_slave_open_reauthentication
gpointer user_data,
GCancellable *cancellable);
+static gboolean wants_initial_setup (GdmSimpleSlave *slave);
+static void destroy_initial_setup_user (GdmSimpleSlave *slave);
G_DEFINE_TYPE (GdmSimpleSlave, gdm_simple_slave, GDM_TYPE_SLAVE)
static void create_new_session (GdmSimpleSlave *slave);
@@ -842,6 +844,9 @@ on_greeter_environment_session_stopped (GdmLaunchEnvir
if (slave->priv->start_session_service_name == NULL) {
gdm_slave_stop (GDM_SLAVE (slave));
} else {
+ if (wants_initial_setup (slave)) {
+ destroy_initial_setup_user (slave);
+ }
start_session (slave);
}
@@ -1118,7 +1123,7 @@ start_greeter (GdmSimpleSlave *slave)
start_launch_environment (slave, GDM_USERNAME, NULL);
}
-#define RULES_DIR LOCALSTATEDIR "/lib/polkit-1/localauthority/10-vendor.d/"
+#define RULES_DIR DATADIR "/polkit-1/rules.d/"
#define RULES_FILE "20-gnome-initial-setup.rules"
static const gboolean
@@ -1147,12 +1152,14 @@ create_initial_setup_user (GdmSimpleSlave *slave)
ret = FALSE;
goto out;
}
+
+ g_clear_error (&error);
} else {
g_object_unref (user);
}
/* Now, make sure the PolicyKit policy is in place */
- src_file = g_file_new_for_path (DATADIR "/gnome-initial-setup" RULES_FILE);
+ src_file = g_file_new_for_path (DATADIR "/gnome-initial-setup/" RULES_FILE);
dest_file = g_file_new_for_path (RULES_DIR RULES_FILE);
if (!g_file_copy (src_file,
@@ -1195,12 +1202,13 @@ destroy_initial_setup_user (GdmSimpleSlave *slave)
error = NULL;
user = act_user_manager_get_user (act, INITIAL_SETUP_USERNAME);
- if (!act_user_manager_delete_user (act, user, TRUE, &error)) {
- g_warning ("Failed to delete user '%s': %s", INITIAL_SETUP_USERNAME, error->message);
- g_error_free (error);
+ if (user != NULL) {
+ if (!act_user_manager_delete_user (act, user, TRUE, &error)) {
+ g_warning ("Failed to delete user '%s': %s", INITIAL_SETUP_USERNAME, error->message);
+ g_error_free (error);
+ }
+ g_object_unref (user);
}
-
- g_object_unref (user);
}
static void
@@ -1208,7 +1216,6 @@ start_initial_setup (GdmSimpleSlave *slave)
{
create_initial_setup_user (slave);
start_launch_environment (slave, INITIAL_SETUP_USERNAME, "gnome-initial-setup");
- destroy_initial_setup_user (slave);
}
static gboolean

View File

@ -0,0 +1,57 @@
$OpenBSD: patch-daemon_gdm-slave_c,v 1.1 2012/10/03 06:40:50 ajacoutot Exp $
From 189cd818bf1592b5b8607793575bcf4e71ba8008 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Mon, 01 Oct 2012 21:52:33 +0000
Subject: slave: let initial-setup have access to its display
--- daemon/gdm-slave.c.orig Mon Sep 24 16:08:48 2012
+++ daemon/gdm-slave.c Tue Oct 2 10:42:23 2012
@@ -545,11 +545,15 @@ gdm_slave_setup_xhost_auth (XHostAddress *host_entries
si_entries[0].typelength = strlen ("localuser");
si_entries[1].type = "localuser";
si_entries[1].typelength = strlen ("localuser");
+ si_entries[2].type = "localuser";
+ si_entries[2].typelength = strlen ("localuser");
si_entries[0].value = "root";
si_entries[0].valuelength = strlen ("root");
si_entries[1].value = GDM_USERNAME;
si_entries[1].valuelength = strlen (GDM_USERNAME);
+ si_entries[2].value = "gnome-initial-setup";
+ si_entries[2].valuelength = strlen ("gnome-initial-setup");
host_entries[0].family = FamilyServerInterpreted;
host_entries[0].address = (char *) &si_entries[0];
@@ -557,6 +561,9 @@ gdm_slave_setup_xhost_auth (XHostAddress *host_entries
host_entries[1].family = FamilyServerInterpreted;
host_entries[1].address = (char *) &si_entries[1];
host_entries[1].length = sizeof (XServerInterpretedAddress);
+ host_entries[2].family = FamilyServerInterpreted;
+ host_entries[2].address = (char *) &si_entries[2];
+ host_entries[2].length = sizeof (XServerInterpretedAddress);
}
static void
@@ -672,8 +679,8 @@ gdm_slave_connect_to_x11_display (GdmSlave *slave)
g_warning ("Unable to connect to display %s", slave->priv->display_name);
ret = FALSE;
} else if (slave->priv->display_is_local) {
- XServerInterpretedAddress si_entries[2];
- XHostAddress host_entries[2];
+ XServerInterpretedAddress si_entries[3];
+ XHostAddress host_entries[3];
g_debug ("GdmSlave: Connected to display %s", slave->priv->display_name);
ret = TRUE;
@@ -909,8 +916,8 @@ gdm_slave_add_user_authorization (GdmSlave *slave,
const char *username,
char **filenamep)
{
- XServerInterpretedAddress si_entries[2];
- XHostAddress host_entries[2];
+ XServerInterpretedAddress si_entries[3];
+ XHostAddress host_entries[3];
gboolean res;
GError *error;
char *filename;

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-gui_libgdm_gdm-user-switching_c,v 1.1 2012/10/03 06:40:50 ajacoutot Exp $
From 1e72815156834468b57f3e5ac1960950c2e9519f Mon Sep 17 00:00:00 2001
From: Tim Lunn <tim@feathertop.org>
Date: Fri, 28 Sep 2012 00:29:00 +0000
Subject: libgdm: correct invalid g_variant format string
--- gui/libgdm/gdm-user-switching.c.orig Tue Sep 25 19:57:36 2012
+++ gui/libgdm/gdm-user-switching.c Tue Oct 2 10:40:56 2012
@@ -251,7 +251,7 @@ seat_can_activate_sessions (GDBusConnection *connectio
return FALSE;
}
- g_variant_get (reply, "(&b)", &ret);
+ g_variant_get (reply, "(b)", &ret);
g_variant_unref (reply);
return ret;

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.47 2012/09/29 19:28:15 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.48 2012/10/03 06:40:50 ajacoutot Exp $
@comment starts a full gnome-session as _gdm which requires a valid homedir
@newgroup _gdm:676
@newuser _gdm:676:_gdm:daemon:GNOME Display Manager:/var/db/gdm:/sbin/nologin
@ -9,6 +9,8 @@
@extraunexec rm -rf /var/db/gdm/.dbus
@extraunexec rm -rf /var/db/gdm/.pulse-cookie
@extraunexec rm -rf /var/db/gdm/.config/dconf/*
@extraunexec rm -rf /var/db/gdm/.config/gnome-session
@extraunexec rm -rf /var/db/gdm/.config/pulse
@extraunexec rm -rf /var/db/gdm/*
@extraunexec rm -rf /var/gdm/*
@extraunexec rm -rf /var/cache/gdm/*